OLD | NEW |
1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_SCHEDULER_H_ | 5 #ifndef SRC_VM_SCHEDULER_H_ |
6 #define SRC_VM_SCHEDULER_H_ | 6 #define SRC_VM_SCHEDULER_H_ |
7 | 7 |
8 #include "src/shared/atomic.h" | 8 #include "src/shared/atomic.h" |
9 | 9 |
10 #include "src/vm/signal.h" | 10 #include "src/vm/signal.h" |
11 #include "src/vm/thread.h" | 11 #include "src/vm/thread.h" |
12 | 12 |
13 namespace fletch { | 13 namespace dartino { |
14 | 14 |
15 class GCThread; | 15 class GCThread; |
16 class Heap; | 16 class Heap; |
17 class Object; | 17 class Object; |
18 class Port; | 18 class Port; |
19 class ProcessQueue; | 19 class ProcessQueue; |
20 class Process; | 20 class Process; |
21 class Program; | 21 class Program; |
22 class Scheduler; | 22 class Scheduler; |
23 | 23 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // is attached. | 127 // is attached. |
128 // | 128 // |
129 // TODO(kustermann): Once we've made more progress on the design of a | 129 // TODO(kustermann): Once we've made more progress on the design of a |
130 // multiprocess system, we should consider making an abstraction for these. | 130 // multiprocess system, we should consider making an abstraction for these. |
131 void ExitAtTermination(Process* process, Signal::Kind kind); | 131 void ExitAtTermination(Process* process, Signal::Kind kind); |
132 void ExitAtUncaughtException(Process* process, bool print_stack); | 132 void ExitAtUncaughtException(Process* process, bool print_stack); |
133 void ExitAtCompileTimeError(Process* process); | 133 void ExitAtCompileTimeError(Process* process); |
134 void ExitAtBreakpoint(Process* process); | 134 void ExitAtBreakpoint(Process* process); |
135 | 135 |
136 private: | 136 private: |
137 friend class Fletch; | 137 friend class Dartino; |
138 friend class WorkerThread; | 138 friend class WorkerThread; |
139 | 139 |
140 // Global scheduler instance. | 140 // Global scheduler instance. |
141 static Scheduler* scheduler_; | 141 static Scheduler* scheduler_; |
142 | 142 |
143 // Worker threads | 143 // Worker threads |
144 static const int kThreadCount = 4; | 144 static const int kThreadCount = 4; |
145 ThreadIdentifier thread_ids_[kThreadCount]; | 145 ThreadIdentifier thread_ids_[kThreadCount]; |
146 WorkerThread* threads_[kThreadCount]; | 146 WorkerThread* threads_[kThreadCount]; |
147 | 147 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 Monitor* monitor_; | 207 Monitor* monitor_; |
208 Program** programs_; | 208 Program** programs_; |
209 int* exitcodes_; | 209 int* exitcodes_; |
210 int count_; | 210 int count_; |
211 int remaining_; | 211 int remaining_; |
212 | 212 |
213 static void CaptureExitCode(Program* program, int exitcode, void* data); | 213 static void CaptureExitCode(Program* program, int exitcode, void* data); |
214 }; | 214 }; |
215 | 215 |
216 | 216 |
217 } // namespace fletch | 217 } // namespace dartino |
218 | 218 |
219 #endif // SRC_VM_SCHEDULER_H_ | 219 #endif // SRC_VM_SCHEDULER_H_ |
OLD | NEW |