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

Method Suspend

preempt/src/xqueue/async_xqueue.cpp:91–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void AsyncXQueue::Suspend(int64_t flags)
92{
93 // If the XQueue is already terminated, it should not be suspended.
94 if (terminated_.load()) return;
95
96 // Will not suspend if it is already suspended.
97 bool expected = false;
98 if (!suspended_.compare_exchange_strong(expected, true)) return;
99
100 if (flags & kQueueSuspendFlagWaitIdle) {
101 // Wait for all HwCommands to be completed,
102 // and the XQueue becomes idle before suspending.
103 cmd_buf_->WaitForNextIdle();
104 } else if (flags & kQueueSuspendFlagWaitAll) {
105 // Wait for all HwCommands to be completed before suspending.
106 this->WaitAll();
107 }
108
109 launch_worker_->Pause();
110 if (level_ >= kPreemptLevelDeactivate) kHwQueue->Deactivate();
111 if (level_ >= kPreemptLevelInterrupt) kHwQueue->Interrupt();
112 if (flags & kQueueSuspendFlagSyncHwQueue) kHwQueue->Synchronize();
113}
114
115void AsyncXQueue::Resume(int64_t flags)
116{

Callers 2

ExecuteSchedOperationMethod · 0.45
XQueueSuspendFunction · 0.45

Calls 6

WaitAllMethod · 0.95
WaitForNextIdleMethod · 0.80
PauseMethod · 0.80
DeactivateMethod · 0.45
InterruptMethod · 0.45
SynchronizeMethod · 0.45

Tested by

no test coverage detected