Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <000501c149eb$9520edf0$022133c6@murphy> From: "Jean Barata" To: Subject: Bug in pthread ? Date: Sun, 30 Sep 2001 22:07:09 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Hello, Here is the problem: if I don't "initialiaze" the mutex in the constructor, it works in any case. but if I "initialize" it, it worked with cygwin1.dll (v1.3.2) and not anymore with cygwin1.dll (v1.3.3) when calling the function "fct", the program waits forever on the "pthread_mutex_lock" instruction (and if I debug it with GDB: &_mutex is NULL) so, is it a bug or is it normal ??? class A { public: A(); void fct(void); private: pthread_mutex_t _mutex; pthread_mutexattr_t _mutex_attr; }; A::A() { pthread_mutexattr_init(&_mutex_attr); pthread_mutex_init(&_mutex, &_mutex_attr); pthread_mutex_unlock(&_mutex); /*********** BUG ??? **************/ } void A::fct(void) { pthread_mutex_lock(&_mutex); /********** WAITING HERE ... ************/ ... pthread_mutex_unlock(&_mutex); } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/