Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Protected Member Functions | List of all members
dart::StressTask Class Reference
Inheritance diagram for dart::StressTask:
dart::StateMachineTask dart::ThreadPool::Task dart::IntrusiveDListEntry< Task >

Public Types

enum  State { kStart = StateMachineTask::kNext }
 
- Public Types inherited from dart::StateMachineTask
enum  State {
  kInitialized = 0 , kEntered , kPleaseExit , kExited ,
  kNext
}
 

Public Member Functions

 StressTask (std::shared_ptr< Data > data)
 
- Public Member Functions inherited from dart::StateMachineTask
 StateMachineTask (std::shared_ptr< Data > data)
 
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 ()
 

Protected Member Functions

Datadata ()
 
virtual void RunInternal ()
 
virtual void RunInternal ()=0
 
- Protected Member Functions inherited from dart::ThreadPool::Task
 Task ()
 

Additional Inherited Members

- Protected Attributes inherited from dart::StateMachineTask
std::shared_ptr< Datadata_
 
Threadthread_ = nullptr
 

Detailed Description

Definition at line 525 of file safepoint_test.cc.

Member Enumeration Documentation

◆ State

Enumerator
kStart 

Definition at line 527 of file safepoint_test.cc.

Constructor & Destructor Documentation

◆ StressTask()

dart::StressTask::StressTask ( std::shared_ptr< Data data)
inlineexplicit

Definition at line 531 of file safepoint_test.cc.

StateMachineTask(std::shared_ptr< Data > data)

Member Function Documentation

◆ data()

Data * dart::StressTask::data ( )
inlineprotected

Definition at line 534 of file safepoint_test.cc.

534{ return reinterpret_cast<Data*>(data_.get()); }
std::shared_ptr< Data > data_
struct PathData * Data(SkPath *path)
Definition: path_ops.cc:52

◆ RunInternal()

virtual void dart::StressTask::RunInternal ( )
inlineprotectedvirtual

Implements dart::StateMachineTask.

Definition at line 536 of file safepoint_test.cc.

536 {
537 data_->WaitUntil(kStart);
538
539 Random random(thread_->isolate_group()->random()->NextUInt64());
540 while (!data()->IsIn(kPleaseExit)) {
541 const auto us = random.NextUInt32() % 3;
542 switch (random.NextUInt32() % 5) {
543 case 0: {
544 DeoptSafepointOperationScope safepoint_op(thread_);
545 OS::SleepMicros(us);
546 break;
547 }
548 case 1: {
549 GcSafepointOperationScope safepoint_op(thread_);
550 OS::SleepMicros(us);
551 break;
552 }
553 case 2: {
554 const bool kBypassSafepoint = false;
555 Thread::ExitIsolateGroupAsHelper(kBypassSafepoint);
556 OS::SleepMicros(us);
558 data_->isolate_group_, Thread::kUnknownTask, kBypassSafepoint);
560 break;
561 }
562 case 3: {
564 OS::SleepMicros(us);
566 break;
567 }
568 case 4: {
571 }
572 break;
573 }
574 }
575 }
576 }
Random * random()
Definition: isolate.h:411
static void SleepMicros(int64_t micros)
uint64_t NextUInt64()
Definition: random.h:26
@ kUnknownTask
Definition: thread.h:346
static Thread * Current()
Definition: thread.h:362
bool IsSafepointRequested() const
Definition: thread.h:937
void ExitSafepoint()
Definition: thread.h:1094
static void ExitIsolateGroupAsHelper(bool bypass_safepoint)
Definition: thread.cc:499
void EnterSafepoint()
Definition: thread.h:1076
IsolateGroup * isolate_group() const
Definition: thread.h:541
void BlockForSafepoint()
Definition: thread.cc:1348
static bool EnterIsolateGroupAsHelper(IsolateGroup *isolate_group, TaskKind kind, bool bypass_safepoint)
Definition: thread.cc:481

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