#include <thread_interrupter.h>
Definition at line 23 of file thread_interrupter.h.
◆ Cleanup()
void dart::ThreadInterrupter::Cleanup |
( |
| ) |
|
|
static |
Definition at line 83 of file thread_interrupter.cc.
83 {
84 {
85 MonitorLocker shutdown_ml(monitor_);
86 if (shutdown_) {
87
88 return;
89 }
90 shutdown_ = true;
91
92 shutdown_ml.Notify();
94 if (FLAG_trace_thread_interrupter) {
96 }
97 }
98
99
103 initialized_ = false;
104
105 if (FLAG_trace_thread_interrupter) {
107 }
108}
static void Join(ThreadJoinId id)
static const ThreadJoinId kInvalidThreadJoinId
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
◆ CleanupCurrentThreadState()
void dart::ThreadInterrupter::CleanupCurrentThreadState |
( |
void * |
state | ) |
|
|
static |
◆ Init()
void dart::ThreadInterrupter::Init |
( |
| ) |
|
|
static |
Definition at line 54 of file thread_interrupter.cc.
54 {
56 if (monitor_ == nullptr) {
57 monitor_ = new Monitor();
58 }
59 ASSERT(monitor_ !=
nullptr);
60 initialized_ = true;
61 shutdown_ = false;
62}
◆ InterruptThread()
static void dart::ThreadInterrupter::InterruptThread |
( |
OSThread * |
thread | ) |
|
|
static |
◆ PrepareCurrentThread()
void * dart::ThreadInterrupter::PrepareCurrentThread |
( |
| ) |
|
|
static |
◆ SetInterruptPeriod()
void dart::ThreadInterrupter::SetInterruptPeriod |
( |
intptr_t |
period | ) |
|
|
static |
Definition at line 111 of file thread_interrupter.cc.
111 {
112 if (!initialized_) {
113
114 return;
115 }
116 MonitorLocker ml(monitor_);
117 if (shutdown_) {
118 return;
119 }
122 interrupt_period_ = period;
123}
◆ Startup()
void dart::ThreadInterrupter::Startup |
( |
| ) |
|
|
static |
Definition at line 64 of file thread_interrupter.cc.
64 {
66 if (FLAG_trace_thread_interrupter) {
68 }
70 {
71 MonitorLocker startup_ml(monitor_);
73 while (!thread_running_) {
74 startup_ml.Wait();
75 }
76 }
78 if (FLAG_trace_thread_interrupter) {
80 }
81}
static int Start(const char *name, ThreadStartFunction function, uword parameter)
◆ WakeUp()
void dart::ThreadInterrupter::WakeUp |
( |
| ) |
|
|
static |
Definition at line 125 of file thread_interrupter.cc.
125 {
126 if (monitor_ == nullptr) {
127
128 return;
129 }
130 {
131 MonitorLocker ml(monitor_);
132 if (shutdown_) {
133
134 return;
135 }
136 if (!initialized_) {
137
138 return;
139 }
140 woken_up_ = true;
141 if (!InDeepSleep()) {
142
143 return;
144 }
145
146 ml.Notify();
147 }
148}
◆ ThreadInterrupterVisitIsolates
friend class ThreadInterrupterVisitIsolates |
|
friend |
The documentation for this class was generated from the following files: