mutex scoped

This commit is contained in:
georgemoralis 2024-12-28 22:13:34 +02:00
parent aed5853242
commit b1ae13f43b
2 changed files with 2 additions and 1 deletions

View File

@ -40,6 +40,7 @@ void RegisterNet(Core::Loader::SymbolsResolver* sym) {
}
int NetPosixInternal::create_socket(int domain, int type, int protocol) {
std::scoped_lock lock{m_mutex};
s_socket sock = socket(domain, type, protocol);
auto id = ++next_id;
socks.emplace(id, sock);

View File

@ -18,8 +18,8 @@ typedef SOCKET s_socket;
#include <sys/socket.h>
typedef int s_socket;
#endif
#include <mutex>
#include <map>
#include <mutex>
namespace Common {
class NativeClock;