mail: IMAP fix deadlock when connection failed
fLocker must be released in IMAPConnectionWorker::_Worker() before WorkerQuit() call. Change-Id: I1e622a711fa3349986560af1118b158696025844 Reviewed-on: https://review.haiku-os.org/705 Reviewed-by: Axel Dörfler <[email protected]>
This commit is contained in:
committed by
Axel Dörfler
parent
a4ba432352
commit
a6a1266240
@@ -717,6 +717,8 @@ IMAPConnectionWorker::MessageExpungeReceived(uint32 index)
|
|||||||
status_t
|
status_t
|
||||||
IMAPConnectionWorker::_Worker()
|
IMAPConnectionWorker::_Worker()
|
||||||
{
|
{
|
||||||
|
status_t status = B_OK;
|
||||||
|
|
||||||
while (!fStopped) {
|
while (!fStopped) {
|
||||||
BAutolock locker(fLocker);
|
BAutolock locker(fLocker);
|
||||||
|
|
||||||
@@ -736,21 +738,16 @@ IMAPConnectionWorker::_Worker()
|
|||||||
|
|
||||||
CommandDeleter deleter(*this, command);
|
CommandDeleter deleter(*this, command);
|
||||||
|
|
||||||
status_t status = B_OK;
|
if (dynamic_cast<QuitCommand*>(command) == NULL) { // do not connect on QuitCommand
|
||||||
|
|
||||||
if (dynamic_cast<QuitCommand*>(command) == NULL) // do not connect on QuitCommand
|
|
||||||
status = _Connect();
|
status = _Connect();
|
||||||
|
if (status != B_OK)
|
||||||
if (status != B_OK) {
|
break;
|
||||||
fOwner.WorkerQuit(this);
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status = command->Process(*this);
|
status = command->Process(*this);
|
||||||
if (status != B_OK) {
|
if (status != B_OK)
|
||||||
fOwner.WorkerQuit(this);
|
break;
|
||||||
return status;
|
|
||||||
}
|
|
||||||
if (!command->IsDone()) {
|
if (!command->IsDone()) {
|
||||||
deleter.Detach();
|
deleter.Detach();
|
||||||
command->SetContinuation();
|
command->SetContinuation();
|
||||||
@@ -759,7 +756,7 @@ IMAPConnectionWorker::_Worker()
|
|||||||
}
|
}
|
||||||
|
|
||||||
fOwner.WorkerQuit(this);
|
fOwner.WorkerQuit(this);
|
||||||
return B_OK;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user