Closed
Bug 36818
Opened 24 years ago
Closed 24 years ago
PR_WaitCondVar(..., PR_INTERVAL_NO_TIMEOUT) broken on beos
Categories
(NSPR :: NSPR, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
4.0.2
People
(Reporter: justin, Assigned: wtc)
Details
Attachments
(1 file)
3.89 KB,
patch
|
Details | Diff | Splinter Review |
the beos version of PR_WaitCondVar() includes an (incorrect) workaround for a bug in a previous version of the beos. this workaround increments the value of the 'timeout' argument before it is evaluated. because PR_INTERVAL_NO_TIMEOUT is currently defined as -1, and PR_INTERVAL_NO_WAIT is currently defined as 0, this effectively turns all forever-blocking cvar waits into non-waits, and PR_WaitCondVar() returns (success) immediately. this causes threads in nsThreadPools to busy wait for tasks, etc.... in fixing the above, i also discovered that, due to a bug in the latest version of the beos, PR_Interrupt() no longer interrupted a thread blocked on a cvar wait (see patch for details).
Reporter | ||
Comment 1•24 years ago
|
||
Assignee | ||
Comment 2•24 years ago
|
||
Matt, Duncan: could you review Justin's patch, especially the patch for btthread.c:PR_Interrupt? Thanks.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → 4.0.1
Version: 4.0.1 → 4.0
Assignee | ||
Comment 3•24 years ago
|
||
I reviewed justin's patch. I modified the patch to follow the existing style of the files. I checked in the patch on the main trunk. /cvsroot/mozilla/nsprpub/pr/src/bthreads/btcvar.c, revision 3.4 /cvsroot/mozilla/nsprpub/pr/src/bthreads/btthread.c, revision 3.4 Note that SeaMonkey is pulling the NSPRPUB_CLIENT_BRANCH of mozilla/nsprpub. I will check in the patch on the NSPRPUB_CLIENT_BRANCH when the mozilla tree re-opens.
Assignee | ||
Comment 4•24 years ago
|
||
Checked in the patch on the NSPRPUB_RELEASE_4_0_BRANCH. /cvsroot/mozilla/nsprpub/pr/src/bthreads/btcvar.c, revision 3.3.58.1 /cvsroot/mozilla/nsprpub/pr/src/bthreads/btthread.c, revision 3.3.58.1 Justin, you might want to run the following NSPR tests to make sure the changes are correct. % cvs co mozilla/nsprpub # check out the tip % cd mozilla/nsprpub % gmake export # this does a debug build % cd pr/tests % gmake export # this builds the tests % cd BeOS5.0_DBG.OBJ % ./cvar -d # a test of condition variables % ./cvar2 # another test of condition variables % ./perf # condition variables, semaphores, etc. % ./intrupt -d # a test of PR_Interrupt
Assignee | ||
Comment 5•24 years ago
|
||
Checked in the fix on the NSPRPUB_CLIENT_BRANCH. /cvsroot/mozilla/nsprpub/pr/src/bthreads/btcvar.c, revision 3.3.72.1 /cvsroot/mozilla/nsprpub/pr/src/bthreads/btthread.c, revision 3.3.72.1
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 6•24 years ago
|
||
i ran the tests, and in doing so, discovered some further problems with the current beos condition variable implementation. however, this patch did indeed fix infinite waits on condition vars, so i'm verifying it as fixed... thanks!
Status: RESOLVED → VERIFIED
Assignee | ||
Updated•24 years ago
|
Target Milestone: 4.0.1 → 4.0.2
You need to log in
before you can comment on or make changes to this bug.
Description
•