OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #ifndef SRC_VM_PROCESS_HANDLE_H_ | 5 #ifndef SRC_VM_PROCESS_HANDLE_H_ |
6 #define SRC_VM_PROCESS_HANDLE_H_ | 6 #define SRC_VM_PROCESS_HANDLE_H_ |
7 | 7 |
8 #include "src/shared/platform.h" | 8 #include "src/shared/platform.h" |
9 | 9 |
10 #include "src/vm/spinlock.h" | 10 #include "src/vm/spinlock.h" |
11 #include "src/vm/refcounted.h" | 11 #include "src/vm/refcounted.h" |
12 | 12 |
13 namespace fletch { | 13 namespace dartino { |
14 | 14 |
15 class Process; | 15 class Process; |
16 class Object; | 16 class Object; |
17 | 17 |
18 class ProcessHandle : public Refcounted<ProcessHandle> { | 18 class ProcessHandle : public Refcounted<ProcessHandle> { |
19 public: | 19 public: |
20 explicit ProcessHandle(Process* process) : process_(process) {} | 20 explicit ProcessHandle(Process* process) : process_(process) {} |
21 | 21 |
22 Spinlock* lock() { return &spinlock_; } | 22 Spinlock* lock() { return &spinlock_; } |
23 | 23 |
(...skipping 13 matching lines...) Expand all Loading... |
37 void OwnerProcessTerminating() { | 37 void OwnerProcessTerminating() { |
38 ScopedSpinlock locker(&spinlock_); | 38 ScopedSpinlock locker(&spinlock_); |
39 ASSERT(process_ != NULL); | 39 ASSERT(process_ != NULL); |
40 process_ = NULL; | 40 process_ = NULL; |
41 } | 41 } |
42 | 42 |
43 Process* process_; | 43 Process* process_; |
44 Spinlock spinlock_; | 44 Spinlock spinlock_; |
45 }; | 45 }; |
46 | 46 |
47 } // namespace fletch | 47 } // namespace dartino |
48 | 48 |
49 #endif // SRC_VM_PROCESS_HANDLE_H_ | 49 #endif // SRC_VM_PROCESS_HANDLE_H_ |
OLD | NEW |