public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* Bug?
@ 2000-09-01  0:28 Jussi Laako
  0 siblings, 0 replies; only message in thread
From: Jussi Laako @ 2000-09-01  0:28 UTC (permalink / raw)
  To: rpj; +Cc: pthreads-win32

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-09-01  0:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-01  0:28 Bug? Jussi Laako

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).