summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2013-02-01 20:27:22 +1300
committerMatthew Parlane <parlane@gmail.com>2013-02-01 20:27:22 +1300
commit6b8bb1b692235290278f5dcc7925dd2d8ecff464 (patch)
tree36ca0619e6a215a26368f629e2119d21002b8c15 /Source
parentf43567e2b322e969de315839518c8c3f5110a55e (diff)
lock_gaurds in spaaaaaaaaaccccce.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp10
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
index c2a078e443..1d64636b59 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
@@ -697,7 +697,7 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 CommandAddress)
u32 s = Memory::Read_U32(BufferIn);
_tSocket * sock = NULL;
{
- std::unique_lock<std::mutex> lk(socketMapMutex);
+ std::lock_guard<std::mutex> lk(socketMapMutex);
if(socketMap.find(s) != socketMap.end())
sock = socketMap[s];
}
@@ -729,7 +729,7 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 CommandAddress)
if (ReturnValue > 0)
{
- std::unique_lock<std::mutex> lk(socketMapMutex);
+ std::lock_guard<std::mutex> lk(socketMapMutex);
_tSocket* sock = new _tSocket();
socketMap[s] = sock;
sock->thread = new std::thread([this, s]{this->socketProcessor(s);});
@@ -773,7 +773,7 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 CommandAddress)
_tSocket * sock = NULL;
{
- std::unique_lock<std::mutex> lk(socketMapMutex);
+ std::lock_guard<std::mutex> lk(socketMapMutex);
if(socketMap.find(s) != socketMap.end())
sock = socketMap[s];
if(sock)
@@ -1344,7 +1344,7 @@ void CWII_IPC_HLE_Device_net_ip_top::socketProcessor(u32 socket)
ERROR_LOG(WII_IPC_NET, "Socket %d has started a thread.... oh dear.", socket);
_tSocket* sock = NULL;
{
- std::unique_lock<std::mutex> lk(socketMapMutex);
+ std::lock_guard<std::mutex> lk(socketMapMutex);
if(socketMap.find(socket) == socketMap.end())
{
ERROR_LOG(WII_IPC_NET, "Socket %d could not be found in the socket map.", socket);
@@ -1780,7 +1780,7 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtlV(u32 CommandAddress)
_tSocket * sock = NULL;
{
- std::unique_lock<std::mutex> lk(socketMapMutex);
+ std::lock_guard<std::mutex> lk(socketMapMutex);
if(socketMap.find(s) != socketMap.end())
sock = socketMap[s];
}
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.h
index 6b98564ca7..e0c559507a 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.h
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.h
@@ -583,7 +583,7 @@ public:
bool getCommand(u32& commandAddress)
{
- std::unique_lock<std::mutex> lk(m_mutex);
+ std::lock_guard<std::mutex> lk(m_mutex);
if (commands.empty())
return false;
commandAddress = commands.front();
@@ -593,7 +593,7 @@ public:
void addCommand(u32 commandAddress)
{
- std::unique_lock<std::mutex> lk(m_mutex);
+ std::lock_guard<std::mutex> lk(m_mutex);
commands.push(commandAddress);
event.Set();
}