SWDEV-372757 - thread check workaround for windows hang

Change-Id: Ie9f87b88dd0f3078ad1919edc336f297f6b40373


[ROCm/clr commit: ecea27eb2d]
このコミットが含まれているのは:
Ajay
2023-01-12 17:55:43 +00:00
committed by Ajay GunaShekar
コミット 3d12929eb8
+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();
}
}