This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread_mutex_init fails

[Get raw message]
Hi!

just to make it clear what we're talking about:

===================================================================
----- Original Message -----
From: "egor duda" <deo@logos-m.ru>
Subject: Re: pthread_mutex_init fails

i believe we have one more known problem problem in pthread
code -- see this thread http://sources.redhat.com/ml/cygwin-patches/2001-q4/msg00224.html
for details. it looks like this patch fixes things:

2001-11-18  Egor Duda  <deo@logos-m.ru>

        * thread.cc (pthread_cond::Signal): Check for correct number
        of waiting threads.

Index: thread.cc
===================================================================
RCS file: /cvs/uberbaum/winsup/cygwin/thread.cc,v
retrieving revision 1.54
diff -u -p -2 -r1.54 thread.cc
--- thread.cc   2001/11/15 11:10:38     1.54
+++ thread.cc   2001/11/17 21:16:12
@@ -506,5 +506,5 @@ pthread_cond::Signal ()
    */
   int spins = 10;
-  while (InterlockedIncrement (&waiting) != (temp - 1) && spins)
+  while (InterlockedIncrement (&waiting) != temp && spins)
     {
       InterlockedDecrement (&waiting);

feel free to apply it if you think it's correct. after this patch only
one thread is waken up when condvar is signalled.
===================================================================

RC> ----- Original Message -----
RC> From: "egor duda" <deo@logos-m.ru>

>> the problem remains that the patched code still won't work on w95, but
>> the current code doesn't work at all!

RC> The current code should run fine on w95 and 2k - it did for me before
RC> committing it 0 I tested on both 9x and 2k.

RC> However the bug is likely the cause for Jasons continued python
RC> failures.

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]