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 Maybe remove this check and test if the result list is empty at the end.
|
||||
server->clientsLock.lockForRead();
|
||||
{
|
||||
QReadLocker clientsLocker(&server->clientsLock);
|
||||
if (!server->getUsers().contains(QString::fromStdString(cmd.user_name())))
|
||||
return Response::RespNameNotFound;
|
||||
server->clientsLock.unlock();
|
||||
}
|
||||
|
||||
Response_GetGamesOfUser *re = new Response_GetGamesOfUser;
|
||||
server->roomsLock.lockForRead();
|
||||
|
|
Loading…
Reference in a new issue