Bug 201405: Backed out the previous checkin. It caused the timeout test to
authorwtc%netscape.com
Wed, 14 May 2003 01:47:18 +0000
changeset 2825 df765c541d148efa8b80816a5d6caa79feca8c3e
parent 2824 f1b474c56749f952d8fb4d799501d22291590cc8
child 2826 ea179b98c0e488f3423b94763045ea6655d3fc3f
push idunknown
push userunknown
push dateunknown
bugs201405
Bug 201405: Backed out the previous checkin. It caused the timeout test to hang.
pr/tests/cvar2.c
--- a/pr/tests/cvar2.c
+++ b/pr/tests/cvar2.c
@@ -97,17 +97,17 @@ static PRInt32 tcount=0;
 void PR_CALLBACK
 SharedCondVarThread(void *_info)
 {
     threadinfo *info = (threadinfo *)_info;
     PRInt32 index;
 
     for (index=0; index<info->loops; index++) {
         PR_Lock(info->lock);
-        while (*info->tcount == 0)
+        if (*info->tcount == 0)
             PR_WaitCondVar(info->cvar, info->timeout);
 #if 0
         printf("shared thread %ld notified in loop %ld\n", info->id, index);
 #endif
         (*info->tcount)--;
         PR_Unlock(info->lock);
 
         PR_Lock(info->exitlock);
@@ -124,17 +124,17 @@ SharedCondVarThread(void *_info)
 void PR_CALLBACK
 PrivateCondVarThread(void *_info)
 {
     threadinfo *info = (threadinfo *)_info;
     PRInt32 index;
 
     for (index=0; index<info->loops; index++) {
         PR_Lock(info->lock);
-        while (*info->tcount == 0) {
+        if (*info->tcount == 0) {
 	    DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n",
 				PR_GetCurrentThread(), info->cvar));
             PR_WaitCondVar(info->cvar, info->timeout);
 	}
 #if 0
         printf("solo   thread %ld notified in loop %ld\n", info->id, index);
 #endif
         (*info->tcount)--;