fixed deadlock condition
This commit is contained in:
parent
de87bc6546
commit
cc3760a7df
1 changed files with 5 additions and 4 deletions
|
@ -403,10 +403,11 @@ Response::ResponseCode Server_ProtocolHandler::cmdGetGamesOfUser(const Command_G
|
||||||
|
|
||||||
// XXX This does not take external users into account.
|
// XXX This does not take external users into account.
|
||||||
// XXX Maybe remove this check and test if the result list is empty at the end.
|
// XXX Maybe remove this check and test if the result list is empty at the end.
|
||||||
server->clientsLock.lockForRead();
|
{
|
||||||
if (!server->getUsers().contains(QString::fromStdString(cmd.user_name())))
|
QReadLocker clientsLocker(&server->clientsLock);
|
||||||
return Response::RespNameNotFound;
|
if (!server->getUsers().contains(QString::fromStdString(cmd.user_name())))
|
||||||
server->clientsLock.unlock();
|
return Response::RespNameNotFound;
|
||||||
|
}
|
||||||
|
|
||||||
Response_GetGamesOfUser *re = new Response_GetGamesOfUser;
|
Response_GetGamesOfUser *re = new Response_GetGamesOfUser;
|
||||||
server->roomsLock.lockForRead();
|
server->roomsLock.lockForRead();
|
||||||
|
|
Loading…
Reference in a new issue