SWDEV-372757 - thread check workaround for windows hang

Change-Id: Ie9f87b88dd0f3078ad1919edc336f297f6b40373
Этот коммит содержится в:
Ajay
2023-01-12 17:55:43 +00:00
коммит произвёл Ajay GunaShekar
родитель 8a973ee882
Коммит ecea27eb2d
+7 -4
Просмотреть файл
@@ -71,9 +71,8 @@ bool HostQueue::terminate() {
} else {
if (Os::isThreadAlive(thread_)) {
Command* marker = nullptr;
// Send a finish if the queue is still accepting commands.
{
if (lastEnqueueCommand_ != nullptr || !amd::IS_HIP) {
ScopedLock sl(queueLock_);
if (thread_.acceptingCommands_) {
marker = new Marker(*this, false);
@@ -84,7 +83,11 @@ bool HostQueue::terminate() {
}
}
if (marker != nullptr) {
marker->awaitCompletion();
if (marker->notifyCmdQueue()) {
while (marker->status() > CL_COMPLETE && Os::isThreadAlive(thread_)) {
amd::Os::yield();
}
}
marker->release();
}
@@ -96,7 +99,7 @@ bool HostQueue::terminate() {
}
// FIXME_lmoriche: fix termination handshake
while (thread_.state() < Thread::FINISHED) {
while (thread_.state() < Thread::FINISHED && Os::isThreadAlive(thread_)) {
Os::yield();
}
}