Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libsnes/bsnes/snes/scheduler/scheduler.cpp
2 views
1
#ifdef SYSTEM_CPP
2
3
Scheduler scheduler;
4
5
void Scheduler::enter() {
6
host_thread = co_active();
7
co_switch(thread);
8
}
9
10
void Scheduler::exit(ExitReason reason) {
11
exit_reason = reason;
12
thread = co_active();
13
co_switch(host_thread);
14
}
15
16
void Scheduler::debug() {
17
exit(ExitReason::DebuggerEvent);
18
}
19
20
void Scheduler::init() {
21
host_thread = co_active();
22
thread = cpu.thread;
23
sync = SynchronizeMode::None;
24
}
25
26
Scheduler::Scheduler() {
27
host_thread = 0;
28
thread = 0;
29
exit_reason = ExitReason::UnknownEvent;
30
}
31
32
#endif
33
34