| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BIN_PROCESS_H_ | 5 #ifndef BIN_PROCESS_H_ |
| 6 #define BIN_PROCESS_H_ | 6 #define BIN_PROCESS_H_ |
| 7 | 7 |
| 8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
| 9 #include "bin/thread.h" | 9 #include "bin/thread.h" |
| 10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 char** os_error_message); | 31 char** os_error_message); |
| 32 | 32 |
| 33 // Kill a process with a given pid. | 33 // Kill a process with a given pid. |
| 34 static bool Kill(intptr_t id, int signal); | 34 static bool Kill(intptr_t id, int signal); |
| 35 | 35 |
| 36 // Terminate the exit code handler thread. Does not return before | 36 // Terminate the exit code handler thread. Does not return before |
| 37 // the thread has terminated. | 37 // the thread has terminated. |
| 38 static void TerminateExitCodeHandler(); | 38 static void TerminateExitCodeHandler(); |
| 39 | 39 |
| 40 static int GlobalExitCode() { | 40 static int GlobalExitCode() { |
| 41 MutexLocker ml(&global_exit_code_mutex_); | 41 MutexLocker ml(global_exit_code_mutex_); |
| 42 return global_exit_code_; | 42 return global_exit_code_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 static void SetGlobalExitCode(int exit_code) { | 45 static void SetGlobalExitCode(int exit_code) { |
| 46 MutexLocker ml(&global_exit_code_mutex_); | 46 MutexLocker ml(global_exit_code_mutex_); |
| 47 global_exit_code_ = exit_code; | 47 global_exit_code_ = exit_code; |
| 48 } | 48 } |
| 49 | 49 |
| 50 static intptr_t CurrentProcessId(); | 50 static intptr_t CurrentProcessId(); |
| 51 | 51 |
| 52 static Dart_Handle GetProcessIdNativeField(Dart_Handle process, | 52 static Dart_Handle GetProcessIdNativeField(Dart_Handle process, |
| 53 intptr_t* pid); | 53 intptr_t* pid); |
| 54 static Dart_Handle SetProcessIdNativeField(Dart_Handle process, | 54 static Dart_Handle SetProcessIdNativeField(Dart_Handle process, |
| 55 intptr_t pid); | 55 intptr_t pid); |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 static int global_exit_code_; | 58 static int global_exit_code_; |
| 59 static dart::Mutex global_exit_code_mutex_; | 59 static dart::Mutex* global_exit_code_mutex_; |
| 60 | 60 |
| 61 DISALLOW_ALLOCATION(); | 61 DISALLOW_ALLOCATION(); |
| 62 DISALLOW_IMPLICIT_CONSTRUCTORS(Process); | 62 DISALLOW_IMPLICIT_CONSTRUCTORS(Process); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace bin | 65 } // namespace bin |
| 66 } // namespace dart | 66 } // namespace dart |
| 67 | 67 |
| 68 #endif // BIN_PROCESS_H_ | 68 #endif // BIN_PROCESS_H_ |
| OLD | NEW |