50 #include <nsIThreadManager.h>
51 #include <nsServiceManagerUtils.h>
76 nsCOMPtr<nsIThreadManager> threadManager = aThreadManager;
78 threadManager = do_GetService(
"@mozilla.org/thread-manager;1", &rv);
79 NS_ENSURE_SUCCESS(rv, PR_FALSE);
84 rv = threadManager->GetIsMainThread(&isMainThread);
85 NS_ENSURE_SUCCESS(rv, PR_FALSE);
96 mozilla::MonitorAutoEnter lock(mMonitor);
100 mMonitor.NotifyAll();
111 const PRIntervalTime expiry = PR_IntervalNow() + aTimeout;
114 mozilla::MonitorAutoEnter lock(mMonitor);
117 if (aTimeout != PR_INTERVAL_NO_WAIT) {
124 PRIntervalTime timeout;
125 if (aTimeout == PR_INTERVAL_NO_TIMEOUT) {
126 timeout = PR_INTERVAL_NO_TIMEOUT;
129 timeout = expiry - PR_IntervalNow();
130 if (PRInt32(timeout) <= 0) {
135 mMonitor.Wait(timeout);
PRBool Wait(PRIntervalTime aTimeout)
PRBool SB_IsMainThread(nsIThreadManager *aThreadManager)
Songbird Thread Utilities Definitions.