mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Ensure sleep is called in direct submission controller
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
548f698722
commit
d440d26c69
@@ -48,22 +48,19 @@ void *DirectSubmissionController::controlDirectSubmissionsState(void *self) {
|
||||
auto controller = reinterpret_cast<DirectSubmissionController *>(self);
|
||||
|
||||
while (!controller->runControlling.load()) {
|
||||
|
||||
if (!controller->keepControlling.load()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(controller->timeout));
|
||||
controller->sleep();
|
||||
}
|
||||
|
||||
while (true) {
|
||||
|
||||
if (!controller->keepControlling.load()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(controller->timeout));
|
||||
|
||||
controller->sleep();
|
||||
controller->checkNewSubmissions();
|
||||
}
|
||||
}
|
||||
@@ -91,4 +88,8 @@ void DirectSubmissionController::checkNewSubmissions() {
|
||||
}
|
||||
}
|
||||
|
||||
void DirectSubmissionController::sleep() {
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(this->timeout));
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -37,6 +37,7 @@ class DirectSubmissionController {
|
||||
|
||||
static void *controlDirectSubmissionsState(void *self);
|
||||
void checkNewSubmissions();
|
||||
MOCKABLE_VIRTUAL void sleep();
|
||||
|
||||
std::unordered_map<CommandStreamReceiver *, DirectSubmissionState> directSubmissions;
|
||||
std::mutex directSubmissionsMutex;
|
||||
|
||||
Reference in New Issue
Block a user