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 From: "Chris Knight" To: Subject: pthread_mutex_trylock does not lock Date: Tue, 3 Dec 2002 09:37:41 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal Hello, I think I have found a problem in the "pthread_mutex_trylock" call. When I run the following code both the trylock and lock return immediately. If I compile this under RedHat 8 it works as I would expect with the trylock locking the mutex and the lock stopping execution. I am running the latest version of cygwin under Windows 2000 Pro with the latest service packs. /* ------------------------------------------------------------------------- -------- */ #include int main (void) { pthread_mutex_t accessMutex = PTHREAD_MUTEX_INITIALIZER; printf ("Init\n"); pthread_mutex_init(&accessMutex, NULL); printf ("Try lock(%d)\n", pthread_mutex_trylock(&accessMutex)); printf ("Lock(%d)\n", pthread_mutex_lock(&accessMutex)); printf ("We should never get here!"); } /* ------------------------------------------------------------------------- -------- */ Chris Knight Development, Teligent Ltd. Office: +44 (1442) 283818 Mobile: +44 (7971) 646218 Email: c DOT knight AT teligent DOT co DOT uk -- 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/