зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1640835 - Bail out early from InputQueue::MainThreadTimeout if sControllerThread has been already discarded. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D85335
This commit is contained in:
Родитель
272f16a911
Коммит
63133b1845
|
@ -677,6 +677,11 @@ InputBlockState* InputQueue::FindBlockForId(uint64_t aInputBlockId,
|
|||
}
|
||||
|
||||
void InputQueue::MainThreadTimeout(uint64_t aInputBlockId) {
|
||||
// It's possible that this function gets called after the controller thread
|
||||
// was discarded during shutdown.
|
||||
if (!APZThreadUtils::IsControllerThreadAlive()) {
|
||||
return;
|
||||
}
|
||||
APZThreadUtils::AssertOnControllerThread();
|
||||
|
||||
INPQ_LOG("got a main thread timeout; block=%" PRIu64 "\n", aInputBlockId);
|
||||
|
|
|
@ -84,6 +84,12 @@ bool APZThreadUtils::IsControllerThread() {
|
|||
return sControllerThread && sControllerThread->IsOnCurrentThread();
|
||||
}
|
||||
|
||||
/*static*/
|
||||
bool APZThreadUtils::IsControllerThreadAlive() {
|
||||
StaticMutexAutoLock lock(sControllerThreadMutex);
|
||||
return !!sControllerThread;
|
||||
}
|
||||
|
||||
/*static*/
|
||||
void APZThreadUtils::DelayedDispatch(already_AddRefed<Runnable> aRunnable,
|
||||
int aDelayMs) {
|
||||
|
|
|
@ -53,6 +53,11 @@ class APZThreadUtils {
|
|||
*/
|
||||
static bool IsControllerThread();
|
||||
|
||||
/**
|
||||
* Returns true if the controller thread is still alive.
|
||||
*/
|
||||
static bool IsControllerThreadAlive();
|
||||
|
||||
/**
|
||||
* Schedules a runnable to run on the controller thread at some time
|
||||
* in the future.
|
||||
|
|
Загрузка…
Ссылка в новой задаче