Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* mutex problem using DECthreads
@ 2001-08-13  6:53 Raj Calisa
  2001-08-13 11:19 ` David Butenhof
  2001-08-13 11:24 ` McNepp
  0 siblings, 2 replies; 3+ messages in thread
From: Raj Calisa @ 2001-08-13  6:53 UTC (permalink / 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...


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-08-13 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-13  6:53 mutex problem using DECthreads Raj Calisa
2001-08-13 11:19 ` David Butenhof
2001-08-13 11:24 ` McNepp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox