--- nono/host/hostnet.cpp 2026/04/29 17:05:47 1.1.1.9 +++ nono/host/hostnet.cpp 2026/04/29 17:05:51 1.1.1.10 @@ -145,7 +145,7 @@ HostNetDevice::SetLogLevel(int loglevel_ { inherited::SetLogLevel(loglevel_); - std::lock_guard guard(driverlock); + RWLockGuard_Read guard(driverlock); if ((bool)driver) { driver->SetLogLevel(loglevel_); } @@ -184,7 +184,7 @@ HostNetDevice::Create2() bool HostNetDevice::SelectDriver(bool startup) { - std::lock_guard guard(driverlock); + RWLockGuard_Write guard(driverlock); driver.reset(); errmsg.clear(); @@ -267,7 +267,7 @@ HostNetDevice::SelectDriver(bool startup } else { // UI に通知してフォールバック。 int n = GetId() - OBJ_HOSTNET0; - UIMessage::Post(UIMessage::HOSTNET_FAILED, n); + gMainApp.GetUIMessage()->Post(UIMessage::HOSTNET_FAILED, n); CreateNone(); } @@ -487,7 +487,7 @@ HostNetDevice::Read() int queued = 0; int left = 0; - std::lock_guard guard(driverlock); + RWLockGuard_Read guard(driverlock); assert((bool)driver); do { @@ -585,7 +585,7 @@ HostNetDevice::Write() { const NetPacket *p; - std::lock_guard guard(driverlock); + RWLockGuard_Read guard(driverlock); assert((bool)driver); // 送信キューから取り出す @@ -625,7 +625,7 @@ HostNetDevice::Write() const std::string HostNetDevice::GetDriverName() { - std::lock_guard guard(driverlock); + RWLockGuard_Read guard(driverlock); assert((bool)driver); return driver->GetDriverName(); } @@ -648,7 +648,7 @@ HostNetDevice::MonitorUpdate(Monitor *, screen.Print(0, 0, "Device(Port) : %s", GetPortName().c_str()); { - std::lock_guard guard(driverlock); + RWLockGuard_Read guard(driverlock); screen.Print(0, 1, "HostNet Driver: %s", driver->GetDriverName()); // 次の2行はドライバ依存情報 driver->MonitorUpdateMD(screen, 2);