#include <lockers.h>
Definition at line 128 of file lockers.h.
◆ MonitorLocker()
dart::MonitorLocker::MonitorLocker |
( |
Monitor * |
monitor, |
|
|
bool |
no_safepoint_scope = true |
|
) |
| |
|
inlineexplicit |
Definition at line 130 of file lockers.h.
131 : monitor_(monitor), no_safepoint_scope_(no_safepoint_scope) {
132 ASSERT(monitor !=
nullptr);
133#if defined(DEBUG)
134 if (no_safepoint_scope_) {
136 if (thread != nullptr) {
137 thread->IncrementNoSafepointScopeDepth();
138 } else {
139 no_safepoint_scope_ = false;
140 }
141 }
142#endif
143 monitor_->Enter();
144 }
static Thread * Current()
◆ ~MonitorLocker()
virtual dart::MonitorLocker::~MonitorLocker |
( |
| ) |
|
|
inlinevirtual |
Definition at line 146 of file lockers.h.
146 {
147 monitor_->Exit();
148#if defined(DEBUG)
149 if (no_safepoint_scope_) {
151 }
152#endif
153 }
void DecrementNoSafepointScopeDepth()
◆ Enter()
void dart::MonitorLocker::Enter |
( |
| ) |
const |
|
inline |
Definition at line 155 of file lockers.h.
155 {
156#if defined(DEBUG)
157 if (no_safepoint_scope_) {
159 }
160#endif
161 monitor_->Enter();
162 }
void IncrementNoSafepointScopeDepth()
◆ Exit()
void dart::MonitorLocker::Exit |
( |
| ) |
const |
|
inline |
Definition at line 163 of file lockers.h.
163 {
164 monitor_->Exit();
165#if defined(DEBUG)
166 if (no_safepoint_scope_) {
168 }
169#endif
170 }
◆ Notify()
void dart::MonitorLocker::Notify |
( |
| ) |
|
|
inline |
Definition at line 184 of file lockers.h.
184{ monitor_->Notify(); }
◆ NotifyAll()
void dart::MonitorLocker::NotifyAll |
( |
| ) |
|
|
inline |
Definition at line 186 of file lockers.h.
186{ monitor_->NotifyAll(); }
◆ Wait()
Definition at line 172 of file lockers.h.
172 {
173 return monitor_->Wait(millis);
174 }
◆ WaitMicros()
Definition at line 180 of file lockers.h.
180 {
181 return monitor_->WaitMicros(micros);
182 }
◆ WaitWithSafepointCheck()
Definition at line 12 of file lockers.cc.
13 {
16#if defined(DEBUG)
17 if (no_safepoint_scope_) {
18 thread->DecrementNoSafepointScopeDepth();
19 }
20#endif
22 thread->EnterSafepoint();
24
25
26 if (!thread->TryExitSafepoint()) {
27
28
29 monitor_->Exit();
30 thread->ExitSafepointUsingLock();
31 monitor_->Enter();
32 }
34#if defined(DEBUG)
35 if (no_safepoint_scope_) {
36 thread->IncrementNoSafepointScopeDepth();
37 }
38#endif
40}
The documentation for this class was generated from the following files: