mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 968016 - Implement nsThreadPool::IsOnCurrentThread() to return true when the current thread is in the thread pool. r=bsmedberg
This is so that we can assert that media decode threads are in the decode thread pool.
This commit is contained in:
parent
898150675c
commit
9bc6df1d23
@ -251,10 +251,14 @@ nsThreadPool::Dispatch(nsIRunnable *event, uint32_t flags)
|
||||
NS_IMETHODIMP
|
||||
nsThreadPool::IsOnCurrentThread(bool *result)
|
||||
{
|
||||
// No one should be calling this method. If this assertion gets hit, then we
|
||||
// need to think carefully about what this method should be returning.
|
||||
NS_NOTREACHED("implement me");
|
||||
|
||||
ReentrantMonitorAutoEnter mon(mEvents.GetReentrantMonitor());
|
||||
nsIThread* thread = NS_GetCurrentThread();
|
||||
for (uint32_t i = 0; i < mThreads.Count(); ++i) {
|
||||
if (mThreads[i] == thread) {
|
||||
*result = true;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
*result = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user