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.
Этот коммит содержится в:
Sang, Tao authored and GitHub committed 2025-04-29 09:55:24 -04:00
1 родитель 99ef573399
Коммит 96cadbc9e9
15 files changed
+34 -898

No files matched your search

+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();
}