diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-02 21:01:38 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-02 21:01:38 +0100 |
commit | f7d30133221896638f7bf4f66c504255c4b14f48 (patch) | |
tree | 5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/pr/tests/many_cv.c | |
parent | 26b297510a11758727438df4669357a2a2bc42ce (diff) | |
download | UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip |
Issue #1338 - Part 1: Update NSPR to 4.24
Diffstat (limited to 'nsprpub/pr/tests/many_cv.c')
-rw-r--r-- | nsprpub/pr/tests/many_cv.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/nsprpub/pr/tests/many_cv.c b/nsprpub/pr/tests/many_cv.c index 8bddd7865..8444c9957 100644 --- a/nsprpub/pr/tests/many_cv.c +++ b/nsprpub/pr/tests/many_cv.c @@ -45,22 +45,24 @@ static PRIntn PR_CALLBACK RealMain( PRIntn argc, char **argv ) while (PL_OPT_EOL != (os = PL_GetNextOpt(opt))) { - if (PL_OPT_BAD == os) continue; + if (PL_OPT_BAD == os) { + continue; + } switch (opt->option) { - case 's': /* number of CVs to association with lock */ - stats = PR_TRUE; - break; - case 'c': /* number of CVs to association with lock */ - cvs = atoi(opt->value); - break; - case 'l': /* number of times to run the tests */ - loops = atoi(opt->value); - break; - case 'h': /* user wants some guidance */ - default: - Help(); /* so give him an earful */ - return 2; /* but not a lot else */ + case 's': /* number of CVs to association with lock */ + stats = PR_TRUE; + break; + case 'c': /* number of CVs to association with lock */ + cvs = atoi(opt->value); + break; + case 'l': /* number of times to run the tests */ + loops = atoi(opt->value); + break; + case 'h': /* user wants some guidance */ + default: + Help(); /* so give him an earful */ + return 2; /* but not a lot else */ } } PL_DestroyOptState(opt); @@ -87,20 +89,24 @@ static PRIntn PR_CALLBACK RealMain( PRIntn argc, char **argv ) for (nl = 0; nl < cvs; ++nl) { PRInt32 ran = RandomNum() % 8; - if (0 == ran) PR_NotifyAllCondVar(cv[nl]); - else for (nc = 0; nc < ran; ++nc) - PR_NotifyCondVar(cv[nl]); + if (0 == ran) { + PR_NotifyAllCondVar(cv[nl]); + } + else for (nc = 0; nc < ran; ++nc) { + PR_NotifyCondVar(cv[nl]); + } } PR_Unlock(ml); } - for (index = 0; index < cvs; ++index) + for (index = 0; index < cvs; ++index) { PR_DestroyCondVar(cv[index]); + } PR_DELETE(cv); PR_DestroyLock(ml); - + printf("PASS\n"); PT_FPrintStats(err, "\nPThread Statistics\n"); @@ -111,7 +117,7 @@ static PRIntn PR_CALLBACK RealMain( PRIntn argc, char **argv ) int main(int argc, char **argv) { PRIntn rv; - + PR_STDIO_INIT(); rv = PR_Initialize(RealMain, argc, argv, 0); return rv; |