SWDEV-450636 - Hostcall Listen thread cause seg fault due to main thread is being destroied by app/test's unload libamdhip64.so call.
Change-Id: I8d4a8d8b6801d9f6eb745c45adf831597def0cb5
[ROCm/clr commit: 4761ecbb15]
Dieser Commit ist enthalten in:
committet von
Jaydeepkumar Patel
Ursprung
f3aedfbec0
Commit
21a5b16faa
@@ -273,12 +273,31 @@ HostcallListener* hostcallListener = nullptr;
|
||||
amd::Monitor listenerLock("Hostcall listener lock");
|
||||
constexpr static uint64_t kTimeoutFloor = K * K * 4;
|
||||
constexpr static uint64_t kTimeoutCeil = K * K * 16;
|
||||
|
||||
static struct Init {
|
||||
enum class State {
|
||||
kDefault = 0,
|
||||
kInit,
|
||||
kDestroy,
|
||||
kExit
|
||||
};
|
||||
volatile State state = State::kDefault;
|
||||
~Init() {
|
||||
if (state == State::kInit) {
|
||||
state = State::kDestroy;
|
||||
while (state == State::kDestroy) {}
|
||||
}
|
||||
}
|
||||
} kHostThreadActive;
|
||||
void HostcallListener::consumePackets() {
|
||||
uint64_t timeout = kTimeoutFloor;
|
||||
uint64_t signal_value = SIGNAL_INIT;
|
||||
kHostThreadActive.state = Init::State::kInit;
|
||||
while (true) {
|
||||
while (true) {
|
||||
if (kHostThreadActive.state == Init::State::kDestroy) {
|
||||
kHostThreadActive.state = Init::State::kExit;
|
||||
return;
|
||||
}
|
||||
uint64_t new_value = doorbell_->Wait(signal_value, device::Signal::Condition::Ne, timeout);
|
||||
if (new_value != signal_value) {
|
||||
signal_value = new_value;
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren