Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: runtime/bin/process_win.cc

Issue 18080010: Remove static mutexes/monitors from dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/process_macos.cc ('k') | runtime/bin/secure_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_win.cc
diff --git a/runtime/bin/process_win.cc b/runtime/bin/process_win.cc
index 1237f1335ac5171ef2e3e245a994f55518e373c7..f6c809a75c550fd975b0afcc130016f2ff46d399 100644
--- a/runtime/bin/process_win.cc
+++ b/runtime/bin/process_win.cc
@@ -80,7 +80,7 @@ class ProcessInfoList {
// is signaled. The callback runs in a independent thread from the OS pool.
// Because the callback depends on the process list containing
// the process, lock the mutex until the process is added to the list.
- MutexLocker locker(&mutex_);
+ MutexLocker locker(mutex_);
HANDLE wait_handle = INVALID_HANDLE_VALUE;
BOOL success = RegisterWaitForSingleObject(
&wait_handle,
@@ -102,7 +102,7 @@ class ProcessInfoList {
HANDLE* handle,
HANDLE* wait_handle,
HANDLE* pipe) {
- MutexLocker locker(&mutex_);
+ MutexLocker locker(mutex_);
ProcessInfo* current = active_processes_;
while (current != NULL) {
if (current->pid() == pid) {
@@ -117,7 +117,7 @@ class ProcessInfoList {
}
static void RemoveProcess(DWORD pid) {
- MutexLocker locker(&mutex_);
+ MutexLocker locker(mutex_);
ProcessInfo* prev = NULL;
ProcessInfo* current = active_processes_;
while (current != NULL) {
@@ -186,12 +186,12 @@ class ProcessInfoList {
static ProcessInfo* active_processes_;
// Mutex protecting all accesses to the linked list of active
// processes.
- static dart::Mutex mutex_;
+ static dart::Mutex* mutex_;
};
ProcessInfo* ProcessInfoList::active_processes_ = NULL;
-dart::Mutex ProcessInfoList::mutex_;
+dart::Mutex* ProcessInfoList::mutex_ = new dart::Mutex();
// Types of pipes to create.
@@ -343,10 +343,10 @@ static DeleteProcThreadAttrListFn delete_proc_thread_attr_list = NULL;
static bool EnsureInitialized() {
static bool load_attempted = false;
- static dart::Mutex mutex;
+ static dart::Mutex* mutex = new dart::Mutex();
HMODULE kernel32_module = GetModuleHandleW(L"kernel32.dll");
if (!load_attempted) {
- MutexLocker locker(&mutex);
+ MutexLocker locker(mutex);
if (load_attempted) return delete_proc_thread_attr_list != NULL;
init_proc_thread_attr_list = reinterpret_cast<InitProcThreadAttrListFn>(
GetProcAddress(kernel32_module, "InitializeProcThreadAttributeList"));
« no previous file with comments | « runtime/bin/process_macos.cc ('k') | runtime/bin/secure_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698