> The error message is from src/libCom/osi/os/posix/osdThread.c at
> the top
> of the routine epicsThreadOnceOsd(), and occurs if mutexLock
> (&onceLock)
> returns a non-zero status. The mutexLock() routine is one of ours
> that
> calls pthread_mutex_lock() and handles retrying in the event that it
> returns EINTR (which violates the SUSv3).
Hi:
Just a vague guess because DDJ just happens to run an article this month
on static initialization of mutexes, pthread_once etc.
(
Developing Lightweight, Statically Initializable C++ Mutexes;
Threadsafe initialization of Singletons
Vladimir Kliatchko
DDJ May 2007
):
Looks like the onceLock used by epicsThreadOnceOsd() needs to be
initialized by a proper call to epicsThreadInit(), which calls
once(), which performs pthread_mutex_init(&onceLock,0).
Then it's destroyed later from an atExit routine.
Maybe that doesn't happen at the correct time, so the bad status
is the result of a destroyed mutex?
Maybe one could simply use static initialization of the onceLock, i.e.:
static pthread_mutex_t onceLock = PTHREAD_MUTEX_INITIALIZER;
?
That way, there's no need to specifically create nor destroy it.
-Kay
_______________________________________________
Core-talk mailing list
[email protected]
http://www.aps.anl.gov/mailman/listinfo/core-talk
- Replies:
- Re: Mutex error on recent Redhat systems Andrew Johnson
- References:
- Re: Mutex error on recent Redhat systems Andrew Johnson
- RE: Mutex error on recent Redhat systems Jeff Hill
- Navigate by Date:
- Prev:
RE: Mutex error on recent Redhat systems Jeff Hill
- Next:
Re: Mutex error on recent Redhat systems Andrew Johnson
- Index:
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: Mutex error on recent Redhat systems Jeff Hill
- Next:
Re: Mutex error on recent Redhat systems Andrew Johnson
- Index:
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|