diff options
Diffstat (limited to 'pr/src/pthreads/ptthread.c')
-rw-r--r-- | pr/src/pthreads/ptthread.c | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/pr/src/pthreads/ptthread.c b/pr/src/pthreads/ptthread.c index dc8cc127..7fc2ad4d 100644 --- a/pr/src/pthreads/ptthread.c +++ b/pr/src/pthreads/ptthread.c @@ -607,9 +607,9 @@ PR_IMPLEMENT(PRStatus) PR_JoinThread(PRThread *thred) return (0 == rv) ? PR_SUCCESS : PR_FAILURE; } /* PR_JoinThread */ -PR_IMPLEMENT(void) PR_DetachThread() { } /* PR_DetachThread */ +PR_IMPLEMENT(void) PR_DetachThread(void) { } /* PR_DetachThread */ -PR_IMPLEMENT(PRThread*) PR_GetCurrentThread() +PR_IMPLEMENT(PRThread*) PR_GetCurrentThread(void) { void *thred; @@ -724,25 +724,25 @@ PR_IMPLEMENT(PRStatus) PR_Interrupt(PRThread *thred) return PR_SUCCESS; } /* PR_Interrupt */ -PR_IMPLEMENT(void) PR_ClearInterrupt() +PR_IMPLEMENT(void) PR_ClearInterrupt(void) { PRThread *me = PR_CurrentThread(); me->state &= ~PT_THREAD_ABORTED; } /* PR_ClearInterrupt */ -PR_IMPLEMENT(void) PR_BlockInterrupt() +PR_IMPLEMENT(void) PR_BlockInterrupt(void) { PRThread *me = PR_CurrentThread(); _PT_THREAD_BLOCK_INTERRUPT(me); } /* PR_BlockInterrupt */ -PR_IMPLEMENT(void) PR_UnblockInterrupt() +PR_IMPLEMENT(void) PR_UnblockInterrupt(void) { PRThread *me = PR_CurrentThread(); _PT_THREAD_UNBLOCK_INTERRUPT(me); } /* PR_UnblockInterrupt */ -PR_IMPLEMENT(PRStatus) PR_Yield() +PR_IMPLEMENT(PRStatus) PR_Yield(void) { static PRBool warning = PR_TRUE; if (warning) warning = _PR_Obsolete( @@ -908,7 +908,7 @@ void _PR_InitThreads( PR_SetThreadPriority(thred, priority); } /* _PR_InitThreads */ -PR_IMPLEMENT(PRStatus) PR_Cleanup() +PR_IMPLEMENT(PRStatus) PR_Cleanup(void) { PRThread *me = PR_CurrentThread(); PR_LOG(_pr_thread_lm, PR_LOG_MIN, ("PR_Cleanup: shutting down NSPR")); @@ -920,7 +920,12 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup() PR_WaitCondVar(pt_book.cv, PR_INTERVAL_NO_TIMEOUT); PR_Unlock(pt_book.ml); + _PR_CleanupMW(); + _PR_CleanupDtoa(); + _PR_CleanupCallOnce(); + _PR_ShutdownLinker(); _PR_LogCleanup(); + _PR_CleanupNet(); /* Close all the fd's before calling _PR_CleanupIO */ _PR_CleanupIO(); @@ -1026,7 +1031,7 @@ static void null_signal_handler(PRIntn sig); * conflict with the use of these two signals in our GC support. * So we don't know how to support GC on Linux pthreads. */ -static void init_pthread_gc_support() +static void init_pthread_gc_support(void) { PRIntn rv; @@ -1066,14 +1071,14 @@ static void init_pthread_gc_support() #endif /* defined(_PR_DCETHREADS) */ } -PR_IMPLEMENT(void) PR_SetThreadGCAble() +PR_IMPLEMENT(void) PR_SetThreadGCAble(void) { PR_Lock(pt_book.ml); PR_CurrentThread()->state |= PT_THREAD_GCABLE; PR_Unlock(pt_book.ml); } -PR_IMPLEMENT(void) PR_ClearThreadGCAble() +PR_IMPLEMENT(void) PR_ClearThreadGCAble(void) { PR_Lock(pt_book.ml); PR_CurrentThread()->state &= (~PT_THREAD_GCABLE); @@ -1086,12 +1091,6 @@ static PRBool suspendAllOn = PR_FALSE; static PRBool suspendAllSuspended = PR_FALSE; -/* Are all GCAble threads (except gc'ing thread) suspended? */ -PR_IMPLEMENT(PRBool) PR_SuspendAllSuspended() -{ - return suspendAllSuspended; -} /* PR_SuspendAllSuspended */ - PR_IMPLEMENT(PRStatus) PR_EnumerateThreads(PREnumerator func, void *arg) { PRIntn count = 0; @@ -1215,7 +1214,7 @@ static void suspend_signal_handler(PRIntn sig) while (me->suspend & PT_THREAD_SUSPENDED) { #if !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD) \ - && !defined(BSDI) && !defined(VMS) && !defined(UNIXWARE) /*XXX*/ + && !defined(BSDI) && !defined(VMS) && !defined(UNIXWARE) && !defined(DARWIN) /*XXX*/ PRIntn rv; sigwait(&sigwait_set, &rv); #endif @@ -1242,12 +1241,12 @@ static void suspend_signal_handler(PRIntn sig) ("End suspend_signal_handler thred = %X tid = %X\n", me, me->id)); } /* suspend_signal_handler */ -static void PR_SuspendSet(PRThread *thred) +static void pt_SuspendSet(PRThread *thred) { PRIntn rv; PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, - ("PR_SuspendSet thred %X thread id = %X\n", thred, thred->id)); + ("pt_SuspendSet thred %X thread id = %X\n", thred, thred->id)); /* @@ -1257,7 +1256,7 @@ static void PR_SuspendSet(PRThread *thred) PR_ASSERT((thred->suspend & PT_THREAD_SUSPENDED) == 0); PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, - ("doing pthread_kill in PR_SuspendSet thred %X tid = %X\n", + ("doing pthread_kill in pt_SuspendSet thred %X tid = %X\n", thred, thred->id)); #if defined(VMS) rv = thread_suspend(thred); @@ -1267,10 +1266,10 @@ static void PR_SuspendSet(PRThread *thred) PR_ASSERT(0 == rv); } -static void PR_SuspendTest(PRThread *thred) +static void pt_SuspendTest(PRThread *thred) { PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, - ("Begin PR_SuspendTest thred %X thread id = %X\n", thred, thred->id)); + ("Begin pt_SuspendTest thred %X thread id = %X\n", thred, thred->id)); /* @@ -1296,13 +1295,13 @@ static void PR_SuspendTest(PRThread *thred) #endif PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, - ("End PR_SuspendTest thred %X tid %X\n", thred, thred->id)); -} /* PR_SuspendTest */ + ("End pt_SuspendTest thred %X tid %X\n", thred, thred->id)); +} /* pt_SuspendTest */ -PR_IMPLEMENT(void) PR_ResumeSet(PRThread *thred) +static void pt_ResumeSet(PRThread *thred) { PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, - ("PR_ResumeSet thred %X thread id = %X\n", thred, thred->id)); + ("pt_ResumeSet thred %X thread id = %X\n", thred, thred->id)); /* * Clear the global state and set the thread state so that it will @@ -1322,12 +1321,12 @@ PR_IMPLEMENT(void) PR_ResumeSet(PRThread *thred) #endif #endif -} /* PR_ResumeSet */ +} /* pt_ResumeSet */ -PR_IMPLEMENT(void) PR_ResumeTest(PRThread *thred) +static void pt_ResumeTest(PRThread *thred) { PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, - ("Begin PR_ResumeTest thred %X thread id = %X\n", thred, thred->id)); + ("Begin pt_ResumeTest thred %X thread id = %X\n", thred, thred->id)); /* * Wait for the threads resume state to change @@ -1351,12 +1350,12 @@ PR_IMPLEMENT(void) PR_ResumeTest(PRThread *thred) thred->suspend &= ~PT_THREAD_RESUMED; PR_LOG(_pr_gc_lm, PR_LOG_ALWAYS, ( - "End PR_ResumeTest thred %X tid %X\n", thred, thred->id)); -} /* PR_ResumeTest */ + "End pt_ResumeTest thred %X tid %X\n", thred, thred->id)); +} /* pt_ResumeTest */ static pthread_once_t pt_gc_support_control = PTHREAD_ONCE_INIT; -PR_IMPLEMENT(void) PR_SuspendAll() +PR_IMPLEMENT(void) PR_SuspendAll(void) { #ifdef DEBUG PRIntervalTime stime, etime; @@ -1379,7 +1378,7 @@ PR_IMPLEMENT(void) PR_SuspendAll() while (thred != NULL) { if ((thred != me) && _PT_IS_GCABLE_THREAD(thred)) - PR_SuspendSet(thred); + pt_SuspendSet(thred); thred = thred->next; } @@ -1388,7 +1387,7 @@ PR_IMPLEMENT(void) PR_SuspendAll() while (thred != NULL) { if ((thred != me) && _PT_IS_GCABLE_THREAD(thred)) - PR_SuspendTest(thred); + pt_SuspendTest(thred); thred = thred->next; } @@ -1402,7 +1401,7 @@ PR_IMPLEMENT(void) PR_SuspendAll() #endif } /* PR_SuspendAll */ -PR_IMPLEMENT(void) PR_ResumeAll() +PR_IMPLEMENT(void) PR_ResumeAll(void) { #ifdef DEBUG PRIntervalTime stime, etime; @@ -1421,7 +1420,7 @@ PR_IMPLEMENT(void) PR_ResumeAll() while (thred != NULL) { if ((thred != me) && _PT_IS_GCABLE_THREAD(thred)) - PR_ResumeSet(thred); + pt_ResumeSet(thred); thred = thred->next; } @@ -1429,7 +1428,7 @@ PR_IMPLEMENT(void) PR_ResumeAll() while (thred != NULL) { if ((thred != me) && _PT_IS_GCABLE_THREAD(thred)) - PR_ResumeTest(thred); + pt_ResumeTest(thred); thred = thred->next; } |