From: Raj Calisa <rajc@ot.com.au>
Subject: mutex problem using DECthreads
Date: Mon, 13 Aug 2001 16:53:33 +1000 [thread overview]
Message-ID: <3B77796D.6218EA20@ot.com.au> (raw)
Hi all,
I am using DECthreads on Digital Unix 4.0F (patch kit 5).
In our, application, one of our threads cause the application
to crash due to an assertion failure. This happens when it tries
to acquire a mutex and it fails. This mutex happens to be a static
mutex. It is wrapped up in a C++ class which is created statically.
The mutex itself is created in the constructor of the class using
pthread_mutex_init() rather than PTHREAD_MUTEX_INITIALIZER. I
remember reading somewhere that all static mutexes must be initialized
using the macro and non-static ones with the init() function, otherwise
one would get undefined behaviour.
Is this true?
If so, does a mutex wrapped into a class whose object gets created
statically qualify as a static mutex?
I checked the documentation in pthread.h and it says that the "sequence"
field of the mutex object is set to 0 initially for static mutexes
initialized with the macro and to some non-zero value for the one
created using the init() call.
The mutex in question is presumably static, but initialized with
the init() call and has a sequence number of "0" when I checked it
under the debugger. The "lock" field wass having a bad value as well,
which explains why mutex_lock() failed.
Is DECthreads doing something consciously to reject the call to
pthread_mutex_init()? I am not ruling out memory corruption, but
I would like to explore other possibilities before delving into
that one.
Thanks
rajanish...
next reply other threads:[~2001-08-13 6:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-13 6:53 Raj Calisa [this message]
2001-08-13 11:19 ` mutex problem using DECthreads David Butenhof
2001-08-13 11:24 ` McNepp
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox