mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1181445 (part 12) - Use nsBaseHashTable::Iterator in xpcom/threads/. r=froydnj.
This commit is contained in:
parent
8b5bd66a0f
commit
4d241772da
@ -48,14 +48,6 @@ ReleaseObject(void* aData)
|
||||
static_cast<nsISupports*>(aData)->Release();
|
||||
}
|
||||
|
||||
static PLDHashOperator
|
||||
AppendAndRemoveThread(PRThread* aKey, nsRefPtr<nsThread>& aThread, void* aArg)
|
||||
{
|
||||
nsThreadArray* threads = static_cast<nsThreadArray*>(aArg);
|
||||
threads->AppendElement(aThread);
|
||||
return PL_DHASH_REMOVE;
|
||||
}
|
||||
|
||||
// statically allocated instance
|
||||
NS_IMETHODIMP_(MozExternalRefCountType)
|
||||
nsThreadManager::AddRef()
|
||||
@ -139,7 +131,11 @@ nsThreadManager::Shutdown()
|
||||
nsThreadArray threads;
|
||||
{
|
||||
OffTheBooksMutexAutoLock lock(mLock);
|
||||
mThreadsByPRThread.Enumerate(AppendAndRemoveThread, &threads);
|
||||
for (auto iter = mThreadsByPRThread.Iter(); !iter.Done(); iter.Next()) {
|
||||
nsRefPtr<nsThread>& thread = iter.GetData();
|
||||
threads.AppendElement(thread);
|
||||
iter.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
// It's tempting to walk the list of threads here and tell them each to stop
|
||||
|
Loading…
Reference in New Issue
Block a user