Hi all, Can anyone explain to me under what circumstances pthread_mutexattr_init returns EBUSY? I read the explanations in http://sources.redhat.com/ml/cygwin/2003-06/msg00431.html and http://www.opengroup.org/onlinepubs/007904975/functions/pthread_mutexatt r_init.html and from that I understand that pthread_mutexattr_init returns EBUSY if one tries to initialize twice. However I get the error in the following part of code (see below & the arrows on the left). The initialization is done only once.
Note: If I initialize pthread_mutexattr_t m_attr with 0 (because it's actually a pointer to a struct according to <sys/types>) the code runs OK. This looks strange to me. Why should I have to initialize a pthread_mutexattr_t by any other means than by calling pthread_mutexattr_init ? MICOMT::Mutex::Mutex(MICO_Boolean locked, Attribute attr) { int result; pthread_mutexattr_t m_attr /* = 0 */; <----- --> result = pthread_mutexattr_init(&m_attr); --> assert(!result); if (attr != Normal) { switch (attr) { case Recursive: result = pthread_mutexattr_settype(&m_attr,PTHREAD_MUTEX_RECURSIVE); assert (!result); break; default: break; } } result = pthread_mutex_init(&_mutex, &m_attr); assert(!result); result = pthread_mutexattr_destroy(&m_attr); assert(!result); if (locked) this->lock(); } TIA Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 email: [EMAIL PROTECTED] web: www.askesis.nl
smime.p7s
Description: S/MIME cryptographic signature