Mail Archives: cygwin/2001/06/14/19:34:42
------=_NextPart_000_03C8_01C0F57D.4C6DDF40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
----- Original Message -----
From: "Greg Smith" <rys AT epaibm DOT rtpnc DOT epa DOT gov>
To: <cygwin AT cygwin DOT com>
Sent: Friday, June 15, 2001 5:26 AM
Subject: hang in pthread_cond_signal
> I am using the cygwin-src snapshot from June 10.
>
> Seems pthread_cond_signal can hang while another thread
> is waiting on the condition AND a pthread_cond_signal
> has been previously issued when no one was waiting on the
> condition. Below is a testcase that illustrates the
> problem:
>
> Thanks,
>
> Greg
>
Thanks for the testcase Greg. The attached patch fixes your testcase.
Rob
Changelog:
Fri June 15 09:25:00 Robert Collins <rbtcollins AT hotmail DOT com>
* thread.cc (pthread_cond::Signal): Release the condition access
variable correctly.
------=_NextPart_000_03C8_01C0F57D.4C6DDF40
Content-Type: application/octet-stream;
name="cond_signal_fix.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="cond_signal_fix.patch"
Index: thread.cc=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /cvs/src/src/winsup/cygwin/thread.cc,v=0A=
retrieving revision 1.33=0A=
diff -u -p -r1.33 thread.cc=0A=
--- thread.cc 2001/06/07 19:55:06 1.33=0A=
+++ thread.cc 2001/06/14 23:23:59=0A=
@@ -442,7 +442,12 @@ pthread_cond::Signal ()=0A=
if (pthread_mutex_lock (&cond_access))=0A=
system_printf ("Failed to lock condition variable access mutex, =
this %0p\n", this);=0A=
if (!verifyable_object_isvalid (mutex, PTHREAD_MUTEX_MAGIC))=0A=
- return;=0A=
+ {=0A=
+ if (pthread_mutex_unlock (&cond_access))=0A=
+ system_printf ("Failed to unlock condition variable access =
mutex, this %0p\n",=0A=
+ this);=0A=
+ return;=0A=
+ }=0A=
PulseEvent (win32_obj_id);=0A=
if (pthread_mutex_unlock (&cond_access))=0A=
system_printf ("Failed to unlock condition variable access mutex, =
this %0p\n", this);=0A=
------=_NextPart_000_03C8_01C0F57D.4C6DDF40
Content-Type: text/plain; charset=us-ascii
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
------=_NextPart_000_03C8_01C0F57D.4C6DDF40--
- Raw text -