SWDEV-485827 release hostcall listener memory regardless of thread status
The early return if the thread is not alive causes memory leaks.
Neither doorbell_ or urilocator are released if the thread is not alive.
This change alters the logic so regardless of the thread status the
HostcallListener releases its memory.
Change-Id: Ie912360ec0e2ee257de9937b1a8d7375e6aebd83
[ROCm/clr commit: f0063ba8da]
Цей коміт міститься в:
зафіксовано
Aidan Belton-Schure
джерело
d05c0310d8
коміт
838cfe1d29
@@ -334,15 +334,14 @@ void HostcallListener::consumePackets() {
|
||||
}
|
||||
|
||||
void HostcallListener::terminate() {
|
||||
if (thread_.state() < Thread::FINISHED && !amd::Os::isThreadAlive(thread_)) {
|
||||
return;
|
||||
}
|
||||
kHostThreadActive.state = Init::State::kExit;
|
||||
doorbell_->Reset(SIGNAL_DONE);
|
||||
if (thread_.state() >= Thread::FINISHED || amd::Os::isThreadAlive(thread_)) {
|
||||
kHostThreadActive.state = Init::State::kExit;
|
||||
doorbell_->Reset(SIGNAL_DONE);
|
||||
|
||||
// FIXME_lmoriche: fix termination handshake
|
||||
while (thread_.state() < Thread::FINISHED) {
|
||||
amd::Os::yield();
|
||||
// FIXME_lmoriche: fix termination handshake
|
||||
while (thread_.state() < Thread::FINISHED) {
|
||||
amd::Os::yield();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача