summaryrefslogtreecommitdiff
path: root/pr/tests/many_cv.c
diff options
context:
space:
mode:
Diffstat (limited to 'pr/tests/many_cv.c')
-rw-r--r--pr/tests/many_cv.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/pr/tests/many_cv.c b/pr/tests/many_cv.c
index 1a408596..8444c995 100644
--- a/pr/tests/many_cv.c
+++ b/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,15 +89,19 @@ 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);