SWDEV-382397 - Move VirtualGPU destruction back to the thread exit

OS can terminate unfinished queue thread from default stream at any
time. Potentially leaving the queue lock in a bad state and causing a
deadlock if runtime destroys VirtualGPU later from the host thread.

Change-Id: I247f102ee84e6b4dba947504933395071945c85d
Dieser Commit ist enthalten in:
German verfasst und German Andryeyev committed 2023-02-17 10:05:49 -05:00
1 Ursprung f98dcf9d7f
Commit 28daf98f1f
2 Dateien geändert
+4 -7

Keine Dateien entsprechen Ihrer Suche

+3 -7
Datei anzeigen
@@ -164,19 +164,13 @@ class HostQueue : public CommandQueue {
acceptingCommands_(false),
virtualDevice_(nullptr) {}
virtual ~Thread() {
if (virtualDevice_ != nullptr) {
delete virtualDevice_;
virtualDevice_ = nullptr;
}
}
//! The command queue thread entry point.
void run(void* data) {
HostQueue* queue = static_cast<HostQueue*>(data);
virtualDevice_ = queue->device().createVirtualDevice(queue);
if (virtualDevice_ != nullptr) {
queue->loop(virtualDevice_);
Release();
} else {
acceptingCommands_ = false;
queue->flush();
@@ -190,6 +184,8 @@ class HostQueue : public CommandQueue {
}
}
void Release() const { delete virtualDevice_; }
//! Get virtual device for the current thread
device::VirtualDevice* vdev() const { return virtualDevice_; }