P4 to Git Change 1550567 by lmoriche@lmoriche_opencl_dev2 on 2018/05/04 16:11:50

SWDEV-145570 - [HIP] - Fix a race condition in the CommandQueue::Thread destruction.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.cpp#25 edit


[ROCm/clr commit: 64d2ad6a88]
Этот коммит содержится в:
foreman
2018-05-04 16:30:54 -04:00
родитель d582a4f193
Коммит 59f58a6baf
+5 -7
Просмотреть файл
@@ -31,14 +31,12 @@ HostQueue::HostQueue(Context& context, Device& device, cl_command_queue_properti
bool HostQueue::terminate() {
if (Os::isThreadAlive(thread_)) {
// Make sure all the commands are finished on the device.
finish();
// Kill the command queue loop.
thread_.acceptingCommands_ = false;
// Wake-up the command loop, so it can exit
flush();
{
ScopedLock sl(queueLock_);
thread_.acceptingCommands_ = false;
queueLock_.notify();
}
// FIXME_lmoriche: fix termination handshake
while (thread_.state() < Thread::FINISHED) {