Bug 913653: Remove lock from IOInterposer and add IOInterposer thread registration; r=froydnj

This commit is contained in:
Aaron Klotz
2014-04-08 22:57:52 -06:00
parent 97b2e94330
commit b3ab7df76b
7 changed files with 398 additions and 229 deletions

View File

@@ -24,6 +24,7 @@
#include "prlog.h"
#include "nsIObserverService.h"
#include "mozilla/HangMonitor.h"
#include "mozilla/IOInterposer.h"
#include "mozilla/Services.h"
#include "nsXPCOMPrivate.h"
#include "mozilla/ChaosMode.h"
@@ -291,6 +292,8 @@ nsThread::ThreadFunc(void *arg)
// Inform the ThreadManager
nsThreadManager::get()->RegisterCurrentThread(self);
mozilla::IOInterposer::RegisterCurrentThread();
// Wait for and process startup event
nsCOMPtr<nsIRunnable> event;
if (!self->GetEvent(true, getter_AddRefs(event))) {
@@ -328,6 +331,8 @@ nsThread::ThreadFunc(void *arg)
}
}
mozilla::IOInterposer::UnregisterCurrentThread();
// Inform the threadmanager that this thread is going away
nsThreadManager::get()->UnregisterCurrentThread(self);