Implement the ability to get the currently running task queue

This will be useful for asserting things.
This commit is contained in:
trav90
2017-03-12 04:06:02 -05:00
committed by roytam1
parent 3090135f8e
commit 533987a47d
4 changed files with 49 additions and 3 deletions
+4 -1
View File
@@ -6,6 +6,7 @@
#include "AbstractThread.h"
#include "MediaTaskQueue.h"
#include "nsThreadUtils.h"
#include "mozilla/ClearOnShutdown.h"
@@ -27,7 +28,9 @@ template<>
bool
AbstractThreadImpl<nsIThread>::IsCurrentThreadIn()
{
return NS_GetCurrentThread() == mTarget;
bool in = NS_GetCurrentThread() == mTarget;
MOZ_ASSERT_IF(in, MediaTaskQueue::GetCurrentQueue() == nullptr);
return in;
}
AbstractThread*