diff options
-rw-r--r-- | src/network/network_udp.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 58d0f31c5..94a677245 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -678,6 +678,8 @@ void NetworkUDPClose() /** Receive the UDP packets. */ void NetworkBackgroundUDPLoop() { + _network_udp_mutex->BeginCritical(); + if (_network_udp_server) { _udp_server_socket->ReceivePackets(); _udp_master_socket->ReceivePackets(); @@ -685,6 +687,8 @@ void NetworkBackgroundUDPLoop() _udp_client_socket->ReceivePackets(); if (_network_udp_broadcast > 0) _network_udp_broadcast--; } + + _network_udp_mutex->EndCritical(); } #endif /* ENABLE_NETWORK */ |