MCPcopy Create free account
hub / github.com/XpuOS/xsched / SetState

Method SetState

preempt/src/xqueue/xcommand.cpp:12–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10}
11
12void XCommand::SetState(XCommandState new_state)
13{
14 XASSERT(new_state >= kCommandStateCreated && new_state <= kCommandStateCompleted,
15 "invalid state: %d", new_state);
16 mtx_.lock();
17 XCommandState old_state = state_;
18 XASSERT(new_state >= old_state, "state should not go back");
19 state_ = new_state;
20 mtx_.unlock();
21
22 if (new_state == old_state) return; // only notify when state changes
23 state_cv_.notify_all();
24 for (int i = old_state + 1; i <= new_state; i++) {
25 for (auto listener : state_listeners_) listener(XCommandState(i));
26 }
27}
28
29void XCommand::WaitUntil(XCommandState state)
30{

Callers 9

DequeueMethod · 0.80
EnqueueMethod · 0.80
DropAllMethod · 0.80
ResumeAndDropMethod · 0.80
WorkerLoopMethod · 0.80
LaunchHwCommandMethod · 0.80
SyncAllWithLockMethod · 0.80
SyncCmdWithLockMethod · 0.80

Calls 3

XCommandStateEnum · 0.85
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected