mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1157488 - Assert against re-entrant sync sections. r=bent
This commit is contained in:
parent
8fcad8fafc
commit
a4b15d3cc0
@ -31,6 +31,7 @@ nsBaseAppShell::nsBaseAppShell()
|
||||
, mSwitchTime(0)
|
||||
, mLastNativeEventTime(0)
|
||||
, mEventloopNestingState(eEventloopNone)
|
||||
, mRunningSyncSections(false)
|
||||
, mRunning(false)
|
||||
, mExiting(false)
|
||||
, mBlockNativeEvent(false)
|
||||
@ -350,6 +351,11 @@ nsBaseAppShell::RunSyncSectionsInternal(bool aStable,
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
NS_ASSERTION(!mSyncSections.IsEmpty(), "Nothing to do!");
|
||||
|
||||
// We don't support re-entering sync sections. This effectively means that
|
||||
// sync sections may not spin the event loop.
|
||||
MOZ_RELEASE_ASSERT(!mRunningSyncSections);
|
||||
mRunningSyncSections = true;
|
||||
|
||||
// We've got synchronous sections. Run all of them that are are awaiting a
|
||||
// stable state if aStable is true (i.e. we really are in a stable state).
|
||||
// Also run the synchronous sections that are simply waiting for the right
|
||||
@ -377,6 +383,7 @@ nsBaseAppShell::RunSyncSectionsInternal(bool aStable,
|
||||
}
|
||||
|
||||
mSyncSections.SwapElements(pendingSyncSections);
|
||||
mRunningSyncSections = false;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -134,6 +134,7 @@ private:
|
||||
};
|
||||
EventloopNestingState mEventloopNestingState;
|
||||
nsTArray<SyncSection> mSyncSections;
|
||||
bool mRunningSyncSections;
|
||||
bool mRunning;
|
||||
bool mExiting;
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user