| 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_LINKS_H_ | 5 #ifndef SRC_VM_LINKS_H_ |
| 6 #define SRC_VM_LINKS_H_ | 6 #define SRC_VM_LINKS_H_ |
| 7 | 7 |
| 8 #include "src/vm/multi_hashset.h" | 8 #include "src/vm/multi_hashset.h" |
| 9 #include "src/vm/port.h" | 9 #include "src/vm/port.h" |
| 10 #include "src/vm/process_handle.h" | 10 #include "src/vm/process_handle.h" |
| 11 #include "src/vm/signal.h" | 11 #include "src/vm/signal.h" |
| 12 #include "src/vm/spinlock.h" | 12 #include "src/vm/spinlock.h" |
| 13 | 13 |
| 14 namespace fletch { | 14 namespace dartino { |
| 15 | 15 |
| 16 class Process; | 16 class Process; |
| 17 | 17 |
| 18 class Links { | 18 class Links { |
| 19 public: | 19 public: |
| 20 Links() : half_dead_(false), exit_kind_(Signal::kTerminated) {} | 20 Links() : half_dead_(false), exit_kind_(Signal::kTerminated) {} |
| 21 ~Links() { | 21 ~Links() { |
| 22 ASSERT(handles_.size() == 0); | 22 ASSERT(handles_.size() == 0); |
| 23 ASSERT(ports_.size() == 0); | 23 ASSERT(ports_.size() == 0); |
| 24 } | 24 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 Spinlock lock_; | 59 Spinlock lock_; |
| 60 // If [half_dead_] is `true` the process will no longer execute any Dart code | 60 // If [half_dead_] is `true` the process will no longer execute any Dart code |
| 61 // and is just waiting for the remaining processes in it's process tree to | 61 // and is just waiting for the remaining processes in it's process tree to |
| 62 // die. | 62 // die. |
| 63 bool half_dead_; | 63 bool half_dead_; |
| 64 Signal::Kind exit_kind_; | 64 Signal::Kind exit_kind_; |
| 65 MultiHashSet<Port*> ports_; | 65 MultiHashSet<Port*> ports_; |
| 66 MultiHashSet<ProcessHandle*> handles_; | 66 MultiHashSet<ProcessHandle*> handles_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace fletch | 69 } // namespace dartino |
| 70 | 70 |
| 71 #endif // SRC_VM_LINKS_H_ | 71 #endif // SRC_VM_LINKS_H_ |
| OLD | NEW |