mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-09-06 21:39:09 +01:00
Merge pull request #11327 from liamwhite/skyline-2
sockets: avoid locking around socket session calls
This commit is contained in:
commit
7d89f2c146
3 changed files with 10 additions and 2 deletions
|
@ -79,8 +79,8 @@ protected:
|
||||||
using HandlerFnP = void (Self::*)(HLERequestContext&);
|
using HandlerFnP = void (Self::*)(HLERequestContext&);
|
||||||
|
|
||||||
/// Used to gain exclusive access to the service members, e.g. from CoreTiming thread.
|
/// Used to gain exclusive access to the service members, e.g. from CoreTiming thread.
|
||||||
[[nodiscard]] std::scoped_lock<std::mutex> LockService() {
|
[[nodiscard]] virtual std::unique_lock<std::mutex> LockService() {
|
||||||
return std::scoped_lock{lock_service};
|
return std::unique_lock{lock_service};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// System context that the service operates under.
|
/// System context that the service operates under.
|
||||||
|
|
|
@ -1029,6 +1029,11 @@ BSD::~BSD() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_lock<std::mutex> BSD::LockService() {
|
||||||
|
// Do not lock socket IClient instances.
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
BSDCFG::BSDCFG(Core::System& system_) : ServiceFramework{system_, "bsdcfg"} {
|
BSDCFG::BSDCFG(Core::System& system_) : ServiceFramework{system_, "bsdcfg"} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
|
|
|
@ -186,6 +186,9 @@ private:
|
||||||
|
|
||||||
// Callback identifier for the OnProxyPacketReceived event.
|
// Callback identifier for the OnProxyPacketReceived event.
|
||||||
Network::RoomMember::CallbackHandle<Network::ProxyPacket> proxy_packet_received;
|
Network::RoomMember::CallbackHandle<Network::ProxyPacket> proxy_packet_received;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual std::unique_lock<std::mutex> LockService() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BSDCFG final : public ServiceFramework<BSDCFG> {
|
class BSDCFG final : public ServiceFramework<BSDCFG> {
|
||||||
|
|
Loading…
Reference in a new issue