mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 1437167 - Part 3: Fix some platform-specific consumers of the Monitor::Wait APIs on a CLOSED TREE, a=bustage
MozReview-Commit-ID: FymGvwEtZRk
This commit is contained in:
parent
08e65e40ba
commit
801a4a8d1a
@ -846,13 +846,6 @@ MessageChannel::SpinInternalEventLoop()
|
||||
} while (true);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
IsTimeoutExpired(PRIntervalTime aStart, PRIntervalTime aTimeout)
|
||||
{
|
||||
return (aTimeout != PR_INTERVAL_NO_TIMEOUT) &&
|
||||
(aTimeout <= (PR_IntervalNow() - aStart));
|
||||
}
|
||||
|
||||
static HHOOK gWindowHook;
|
||||
|
||||
static inline void
|
||||
@ -1030,27 +1023,21 @@ MessageChannel::WaitForSyncNotify(bool aHandleWindowsMessages)
|
||||
// Use a blocking wait if this channel does not require
|
||||
// Windows message deferral behavior.
|
||||
if (!(mFlags & REQUIRE_DEFERRED_MESSAGE_PROTECTION) || !aHandleWindowsMessages) {
|
||||
PRIntervalTime timeout = (kNoTimeout == mTimeoutMs) ?
|
||||
PR_INTERVAL_NO_TIMEOUT :
|
||||
PR_MillisecondsToInterval(mTimeoutMs);
|
||||
PRIntervalTime waitStart = 0;
|
||||
|
||||
if (timeout != PR_INTERVAL_NO_TIMEOUT) {
|
||||
waitStart = PR_IntervalNow();
|
||||
}
|
||||
TimeDuration timeout = (kNoTimeout == mTimeoutMs) ?
|
||||
TimeDuration::Forever() :
|
||||
TimeDuration::FromMilliseconds(mTimeoutMs);
|
||||
|
||||
MOZ_ASSERT(!mIsSyncWaitingOnNonMainThread);
|
||||
mIsSyncWaitingOnNonMainThread = true;
|
||||
|
||||
mMonitor->Wait(timeout);
|
||||
CVStatus status = mMonitor->Wait(timeout);
|
||||
|
||||
MOZ_ASSERT(mIsSyncWaitingOnNonMainThread);
|
||||
mIsSyncWaitingOnNonMainThread = false;
|
||||
|
||||
// If the timeout didn't expire, we know we received an event. The
|
||||
// converse is not true.
|
||||
return WaitResponse(timeout == PR_INTERVAL_NO_TIMEOUT ?
|
||||
false : IsTimeoutExpired(waitStart, timeout));
|
||||
return WaitResponse(status == CVStaus::Timeout);
|
||||
}
|
||||
|
||||
NS_ASSERTION(mFlags & REQUIRE_DEFERRED_MESSAGE_PROTECTION,
|
||||
|
@ -97,7 +97,7 @@ UpdateDriverSetupMacCommandLine(int& argc, char**& argv, bool restart)
|
||||
|
||||
// The length of this wait is arbitrary, but should be long enough that having
|
||||
// it expire means something is seriously wrong.
|
||||
rv = MonitorAutoLock(monitor).Wait(PR_SecondsToInterval(60));
|
||||
rv = MonitorAutoLock(monitor).Wait(TimeDuration::FromSeconds(60));
|
||||
if (NS_FAILED(rv)) {
|
||||
LOG(("Update driver timed out waiting for SetupMacCommandLine: %d\n", rv));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user