mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-08 17:50:31 +01:00
ipmi: use cv to wait async responses
This commit is contained in:
parent
2c781626d3
commit
83ee2942fc
|
|
@ -71,6 +71,7 @@ struct IpmiClient : RcBase {
|
|||
Ref<IpmiSession> session;
|
||||
shared_mutex mutex;
|
||||
shared_cv sessionCv;
|
||||
shared_cv asyncResponseCv;
|
||||
Process *process;
|
||||
kdeque<MessageQueue> messageQueues;
|
||||
kdeque<EventFlag> eventFlags;
|
||||
|
|
|
|||
|
|
@ -504,13 +504,16 @@ orbis::SysResult orbis::sysImpiSessionRespondAsync(Thread *thread,
|
|||
ORBIS_RET_ON_ERROR(ureadRaw(elem.data(), data.data, data.size));
|
||||
}
|
||||
|
||||
std::lock_guard clientLock(client->mutex);
|
||||
client->asyncResponses.push_back({
|
||||
.methodId = _params.method,
|
||||
.errorCode = _params.result,
|
||||
.data = std::move(outData),
|
||||
});
|
||||
{
|
||||
std::lock_guard clientLock(client->mutex);
|
||||
client->asyncResponses.push_back({
|
||||
.methodId = _params.method,
|
||||
.errorCode = _params.result,
|
||||
.data = std::move(outData),
|
||||
});
|
||||
}
|
||||
|
||||
client->asyncResponseCv.notify_all(client->mutex);
|
||||
return uwrite(result, 0u);
|
||||
}
|
||||
|
||||
|
|
@ -591,7 +594,7 @@ orbis::SysResult orbis::sysIpmiClientTryGetResult(Thread *thread,
|
|||
}
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(200));
|
||||
client->asyncResponseCv.wait(client->mutex);
|
||||
}
|
||||
|
||||
// return uwrite(result, 0x80020000 + static_cast<int>(ErrorCode::AGAIN));
|
||||
|
|
|
|||
Loading…
Reference in a new issue