Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
dart::DartInitializationState Class Reference
Inheritance diagram for dart::DartInitializationState:
dart::AllStatic

Static Public Member Functions

static bool SetInitializing ()
 
static void ResetInitializing ()
 
static void SetInitialized ()
 
static bool IsInitialized ()
 
static bool SetCleaningup ()
 
static void SetUnInitialized ()
 
static bool SetInUse ()
 
static void ResetInUse ()
 

Detailed Description

Definition at line 102 of file dart.cc.

Member Function Documentation

◆ IsInitialized()

static bool dart::DartInitializationState::IsInitialized ( )
inlinestatic

Definition at line 124 of file dart.cc.

124{ return state_.load() == kInitialized; }

◆ ResetInitializing()

static void dart::DartInitializationState::ResetInitializing ( )
inlinestatic

Definition at line 110 of file dart.cc.

110 {
111 ASSERT(in_use_count_.load() == 0);
112 uint8_t expected = kInitializing;
113 bool result = state_.compare_exchange_strong(expected, kUnInitialized);
114 ASSERT(result);
115 }
#define ASSERT(E)
GAsyncResult * result

◆ ResetInUse()

static void dart::DartInitializationState::ResetInUse ( )
inlinestatic

Definition at line 148 of file dart.cc.

148 {
149 uint8_t value = state_.load();
150 ASSERT((value == kInitialized) || (value == kCleaningup));
151 in_use_count_ -= 1;
152 }
uint8_t value

◆ SetCleaningup()

static bool dart::DartInitializationState::SetCleaningup ( )
inlinestatic

Definition at line 126 of file dart.cc.

126 {
127 uint8_t expected = kInitialized;
128 return state_.compare_exchange_strong(expected, kCleaningup);
129 }

◆ SetInitialized()

static void dart::DartInitializationState::SetInitialized ( )
inlinestatic

Definition at line 117 of file dart.cc.

117 {
118 ASSERT(in_use_count_.load() == 0);
119 uint8_t expected = kInitializing;
120 bool result = state_.compare_exchange_strong(expected, kInitialized);
121 ASSERT(result);
122 }

◆ SetInitializing()

static bool dart::DartInitializationState::SetInitializing ( )
inlinestatic

Definition at line 104 of file dart.cc.

104 {
105 ASSERT(in_use_count_.load() == 0);
106 uint8_t expected = kUnInitialized;
107 return state_.compare_exchange_strong(expected, kInitializing);
108 }

◆ SetInUse()

static bool dart::DartInitializationState::SetInUse ( )
inlinestatic

Definition at line 140 of file dart.cc.

140 {
141 if (state_.load() != kInitialized) {
142 return false;
143 }
144 in_use_count_ += 1;
145 return true;
146 }

◆ SetUnInitialized()

static void dart::DartInitializationState::SetUnInitialized ( )
inlinestatic

Definition at line 131 of file dart.cc.

131 {
132 while (in_use_count_.load() > 0) {
133 OS::Sleep(1); // Sleep for 1 millis waiting for it to not be in use.
134 }
135 uint8_t expected = kCleaningup;
136 bool result = state_.compare_exchange_strong(expected, kUnInitialized);
137 ASSERT(result);
138 }
static void Sleep(int64_t millis)

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