Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Mime-Version: 1.0 (Apple Message framework v622) Message-Id: <44f83c19cc33e4382680fe3758164ccf@rehley.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed To: "Cygwin List'" From: Peter Rehley Subject: pthreads, cygwin and pthread_mutex_lock not blocking Date: Fri, 27 May 2005 10:57:34 -0700 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j4RHvmuZ011795 Hi, I'm trying to use pthread in cygwin, and I'm expecting the function pthread_mutex_lock to block when used. However it is returning error 45 (EDEADLK). I'm using a static initializer for the thread so the mutex is type PTHREAD_MUTEX_DEFAULT. When I look through the pthread code I see that PTHREAD_MUTEX_DEFAULT is set to PTHREAD_MUTEX_ERRORCHECK, When I do the same on linux or soloris, the pthread_mutex_lock blocks, and looking in the pthread.h file on those systems see that the default is set to PTHREAD_MUTEX_NORMAL. Why is cygwin using PTHREAD_MUTEX_ERRORCHECK as the default? And what problems might occur if PTHREAD_MUTEX_DEFAULT is set to PTHREAD_MUTEX_NORMAL? The reason why I'm asking is because the application that I'm working on needs to work on linux, soloris and cygwin, and keeping the code the same is important. Thanks, Peter ------------------------------- A Møøse once bit my sister -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/