This is the mail archive of the
pthreads-win32@sources.redhat.com
mailing list for the pthreas-win32 project.
Bug?
- To: rpj at ise dot canberra dot edu dot au
- Subject: Bug?
- From: Jussi Laako <jussi dot laako at imagesoft dot fi>
- Date: Fri, 01 Sep 2000 10:28:57 +0300
- CC: pthreads-win32 at sources dot redhat dot com
- Organization: Image Soft Oy
Hello,
There seems to be a bug in condition variable implementation in the latest
snapshot. Deadlock caused by pthread_cond_wait not releasing mutex. It was
working (?) before... Also nonportable.c seems to be missing from CVS, please
add.
Here's some output from my program:
Message: ENTER MUTEX WAIT
Message: LEAVE MUTEX WAIT
Message: ENTER MUTEX WAIT
Message: LEAVE MUTEX WAIT
Message: Fri Sep 01 10:14:04 Client connected from 127.0.0.1:1108
Message: Enter mutex wait
Message: Enter condition wait
Message: ENTER MUTEX WAIT
Message: LEAVE MUTEX WAIT
Message: ENTER MUTEX WAIT
And here are the relevant parts of the program:
--- 8< ---
g_message("ENTER MUTEX WAIT");
if (!MtxData.Wait()) g_error("Got bitten by a dog");
g_message("LEAVE MUTEX WAIT");
Convert((float *) Data.GetPtr(), ipHalfData, iHalfDataCount, sCfg.iBits);
CndData.NotifyAll();
MtxData.Release();
--- 8< ---
g_message("Enter mutex wait");
if (!MtxData.Wait()) g_error("Got bitten by a cat");
g_message("Enter condition wait");
CndData.Wait(MtxData.GetPtr());
g_message("Condition received");
CopyChannel((float *) LocalData.GetPtr(), (float *) Data.GetPtr(),
sReq.iChannel, sCfg.iChannels, sCfg.iSampleCount);
MtxData.Release();
--- 8< ---
This was working before I upgraded to latest snapshot and also works under
Linux.
- Jussi Laako
--
PGP key fingerprint: 3827 6A53 B7F9 180E D971 362B BB53 C8A1 B578 D249
Available at: ldap://certserver.pgp.com