SWDEV-520352 - Remove HostThread and legacy monitor (#230)

* SWDEV-520352 - Remove HostThread and legacy monitor

Remove HostThread, semaphore and  legacy monitor.
Make original logics of thread and command queue stricker.
Add more comments to make logics clearer.
Some other minor improvement.

Also part of SWDEV-458943.

[ROCm/clr commit: 96cadbc9e9]
Этот коммит содержится в:
Sang, Tao
2025-04-29 09:55:24 -04:00
коммит произвёл GitHub
родитель c4567a9188
Коммит 68deb3d10a
15 изменённых файлов: 34 добавлений и 898 удалений
+5 -1
Просмотреть файл
@@ -51,7 +51,10 @@ HostQueue::HostQueue(Context& context, Device& device, cl_command_queue_properti
if (thread_.state() >= Thread::INITIALIZED) {
ScopedLock sl(queueLock_);
thread_.start(this);
queueLock_.wait();
// wait for HostQueue::loop() to update acceptingCommands_ as true
while (!thread_.acceptingCommands_) {
queueLock_.wait();
}
}
}
}
@@ -204,6 +207,7 @@ void HostQueue::loop(device::VirtualDevice* virtualDevice) {
// Notify the caller that the queue is ready to accept commands.
{
ScopedLock sl(queueLock_);
// Notify HostQueue() that acceptingCommands_ is updated to true
thread_.acceptingCommands_ = true;
queueLock_.notify();
}