break; case 'r': resume = PR_TRUE;
PRIntn main(PRIntn argc, char *argv[]){    PRThread *tJitter;    PRThread *tAccept;    PRThread *tConnect;    PRStatus rv;    /* This test if valid for WinNT only! */#if !defined(WINNT)    return 0;#endif    {        /*        ** Get command line options        */        PLOptStatus os;        PLOptState *opt = PL_CreateOptState(argc, argv, "hdvj:");	    while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))        {		    if (PL_OPT_BAD == os) continue;            switch (opt->option)            {            case 'd':  /* debug */                debug = 1;			    msgLevel = PR_LOG_ERROR;                break;            case 'v':  /* verbose mode */                verbose = 1;			    msgLevel = PR_LOG_DEBUG;                break;            case 'j':                jitter = atoi(opt->value);                if ( jitter == 0)                    jitter = JITTER_DEFAULT;                break;            case 'h':  /* help message */			    Help();                break;             default:                break;            }        }	    PL_DestroyOptState(opt);    }    lm = PR_NewLogModule("Test");       /* Initialize logging */    /* set concurrency */    PR_SetConcurrency( 4 );    /* setup thread synchronization mechanics */    ml = PR_NewLock();    cv = PR_NewCondVar( ml );    /* setup a tcp socket */    memset(&listenAddr, 0, sizeof(listenAddr));    rv = PR_InitializeNetAddr(PR_IpAddrAny, BASE_PORT, &listenAddr);    PR_ASSERT( PR_SUCCESS == rv );    listenSock = PR_NewTCPSocket();    PR_ASSERT( listenSock );    rv = PR_Bind( listenSock, &listenAddr);    PR_ASSERT( PR_SUCCESS == rv );    rv = PR_Listen( listenSock, 5 );    PR_ASSERT( PR_SUCCESS == rv );    /* open a file for writing, provoke bug */    file1 = PR_Open("xxxTestFile", PR_CREATE_FILE | PR_RDWR, 666);    /* create Connect thread */    tConnect = PR_CreateThread(        PR_USER_THREAD, ConnectThread, NULL,        PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,        PR_JOINABLE_THREAD, 0 );    PR_ASSERT( tConnect );    /* create jitter off thread */    tJitter = PR_CreateThread(        PR_USER_THREAD, JitterThread, NULL,        PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,        PR_JOINABLE_THREAD, 0 );    PR_ASSERT( tJitter );    /* create acceptread thread */    tAccept = PR_CreateThread(        PR_USER_THREAD, AcceptThread, NULL,        PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,        PR_JOINABLE_THREAD, 0 );    PR_ASSERT( tAccept );    /* wait for all threads to quit, then terminate gracefully */    PR_JoinThread( tConnect );    PR_JoinThread( tAccept );    PR_JoinThread( tJitter );    PR_Close( listenSock );    PR_DestroyCondVar(cv);    PR_DestroyLock(ml);    PR_Close( file1 );    PR_Delete( "xxxTestFile");    /* test return and exit */    if (debug) printf("%s\n", (failed_already)? "FAIL" : "PASS");    return( (failed_already == PR_TRUE )? 1 : 0 );}  /* main() */