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

Unified Diff: runtime/bin/process_linux.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_android.cc ('k') | runtime/bin/process_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_linux.cc
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index e55cb5d029e9bab776550aefa4924ae00f46f622..7d974252e63dc34366281f842d6a9ed05c884172 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -57,7 +57,7 @@ class ProcessInfo {
class ProcessInfoList {
public:
static void AddProcess(pid_t pid, intptr_t fd) {
- MutexLocker locker(&mutex_);
+ MutexLocker locker(mutex_);
ProcessInfo* info = new ProcessInfo(pid, fd);
info->set_next(active_processes_);
active_processes_ = info;
@@ -65,7 +65,7 @@ class ProcessInfoList {
static intptr_t LookupProcessExitFd(pid_t pid) {
- MutexLocker locker(&mutex_);
+ MutexLocker locker(mutex_);
ProcessInfo* current = active_processes_;
while (current != NULL) {
if (current->pid() == pid) {
@@ -78,7 +78,7 @@ class ProcessInfoList {
static void RemoveProcess(pid_t pid) {
- MutexLocker locker(&mutex_);
+ MutexLocker locker(mutex_);
ProcessInfo* prev = NULL;
ProcessInfo* current = active_processes_;
while (current != NULL) {
@@ -102,12 +102,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();
// The exit code handler sets up a separate thread which is signalled
@@ -121,7 +121,7 @@ class ExitCodeHandler {
// Multiple isolates could be starting processes at the same
// time. Make sure that only one of them initializes the
// ExitCodeHandler.
- MutexLocker locker(&mutex_);
+ MutexLocker locker(mutex_);
if (initialized_) {
return true;
}
@@ -157,7 +157,7 @@ class ExitCodeHandler {
}
static void TerminateExitCodeThread() {
- MutexLocker locker(&mutex_);
+ MutexLocker locker(mutex_);
if (!initialized_) {
return;
}
@@ -170,7 +170,7 @@ class ExitCodeHandler {
}
{
- MonitorLocker terminate_locker(&thread_terminate_monitor_);
+ MonitorLocker terminate_locker(thread_terminate_monitor_);
while (!thread_terminated_) {
terminate_locker.Wait();
}
@@ -178,7 +178,7 @@ class ExitCodeHandler {
}
static void ExitCodeThreadTerminated() {
- MonitorLocker locker(&thread_terminate_monitor_);
+ MonitorLocker locker(thread_terminate_monitor_);
thread_terminated_ = true;
locker.Notify();
}
@@ -253,19 +253,19 @@ class ExitCodeHandler {
}
}
- static dart::Mutex mutex_;
+ static dart::Mutex* mutex_;
static bool initialized_;
static int sig_chld_fds_[2];
static bool thread_terminated_;
- static dart::Monitor thread_terminate_monitor_;
+ static dart::Monitor* thread_terminate_monitor_;
};
-dart::Mutex ExitCodeHandler::mutex_;
+dart::Mutex* ExitCodeHandler::mutex_ = new dart::Mutex();
bool ExitCodeHandler::initialized_ = false;
int ExitCodeHandler::sig_chld_fds_[2] = { 0, 0 };
bool ExitCodeHandler::thread_terminated_ = false;
-dart::Monitor ExitCodeHandler::thread_terminate_monitor_;
+dart::Monitor* ExitCodeHandler::thread_terminate_monitor_ = new dart::Monitor();
static void SetChildOsErrorMessage(char** os_error_message) {
« no previous file with comments | « runtime/bin/process_android.cc ('k') | runtime/bin/process_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698