Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Attributes | List of all members
dart::InterruptChecker Class Reference
Inheritance diagram for dart::InterruptChecker:
dart::ThreadPool::Task dart::IntrusiveDListEntry< Task >

Public Member Functions

 InterruptChecker (Thread *thread, ThreadBarrier *barrier)
 
virtual void Run ()
 
- Public Member Functions inherited from dart::ThreadPool::Task
virtual ~Task ()
 
virtual void Run ()=0
 
- Public Member Functions inherited from dart::IntrusiveDListEntry< Task >
 IntrusiveDListEntry ()
 
 ~IntrusiveDListEntry ()
 

Static Public Attributes

static constexpr intptr_t kTaskCount = 5
 
static constexpr intptr_t kIterations = 10
 

Additional Inherited Members

- Protected Member Functions inherited from dart::ThreadPool::Task
 Task ()
 

Detailed Description

Definition at line 110 of file isolate_test.cc.

Constructor & Destructor Documentation

◆ InterruptChecker()

dart::InterruptChecker::InterruptChecker ( Thread thread,
ThreadBarrier barrier 
)
inline

Definition at line 115 of file isolate_test.cc.

116 : thread_(thread), barrier_(barrier) {}

Member Function Documentation

◆ Run()

virtual void dart::InterruptChecker::Run ( )
inlinevirtual

Implements dart::ThreadPool::Task.

Definition at line 118 of file isolate_test.cc.

118 {
119 const bool kBypassSafepoint = false;
121 Thread::kUnknownTask, kBypassSafepoint);
122 // Tell main thread that we are ready.
123 barrier_->Sync();
124 for (intptr_t i = 0; i < kIterations; ++i) {
125 // Busy wait for interrupts.
126 uword limit = 0;
127 do {
128 limit = reinterpret_cast<RelaxedAtomic<uword>*>(
129 thread_->stack_limit_address())
130 ->load();
131 } while (
132 (limit == thread_->saved_stack_limit_) ||
133 (((limit & Thread::kInterruptsMask) & Thread::kVMInterrupt) == 0));
134 // Tell main thread that we observed the interrupt.
135 barrier_->Sync();
136 }
137 Thread::ExitIsolateGroupAsHelper(kBypassSafepoint);
138 barrier_->Sync();
139 barrier_->Release();
140 }
SI T load(const P *ptr)
Definition: Transform_inl.h:98
static constexpr intptr_t kIterations
@ kVMInterrupt
Definition: thread.h:488
@ kInterruptsMask
Definition: thread.h:491
@ kUnknownTask
Definition: thread.h:346
static void ExitIsolateGroupAsHelper(bool bypass_safepoint)
Definition: thread.cc:499
uword stack_limit_address() const
Definition: thread.h:399
IsolateGroup * isolate_group() const
Definition: thread.h:541
static bool EnterIsolateGroupAsHelper(IsolateGroup *isolate_group, TaskKind kind, bool bypass_safepoint)
Definition: thread.cc:481
uintptr_t uword
Definition: globals.h:501

Member Data Documentation

◆ kIterations

constexpr intptr_t dart::InterruptChecker::kIterations = 10
staticconstexpr

Definition at line 113 of file isolate_test.cc.

◆ kTaskCount

constexpr intptr_t dart::InterruptChecker::kTaskCount = 5
staticconstexpr

Definition at line 112 of file isolate_test.cc.


The documentation for this class was generated from the following file: