-- minor changes fixing a race issue in start busy and not resetting the head of the list on delete which caused major issues.

This commit is contained in:
pfelt
2008-04-14 03:50:33 +00:00
parent 36e601d2d8
commit db73be2e9b
+5 -5
View File
@@ -34,15 +34,15 @@ StartBusy(ImapSession *session, char *Message)
}
/* add ourselves to the list */
XplWaitOnLocalSemaphore(Imap.sem_Busy);
Imap.list_Busy = BongoListPrepend(Imap.list_Busy, session);
XplSignalLocalSemaphore(Imap.sem_Busy);
p->last_update = time(0);
p->messages_processed = 0;
p->message = MemStrdup(Message);
session->progress = p;
XplWaitOnLocalSemaphore(Imap.sem_Busy);
Imap.list_Busy = BongoListPrepend(Imap.list_Busy, session);
XplSignalLocalSemaphore(Imap.sem_Busy);
return;
}
@@ -51,7 +51,7 @@ void
StopBusy(ImapSession *session)
{
XplWaitOnLocalSemaphore(Imap.sem_Busy);
BongoListDelete(Imap.list_Busy, session, FALSE);
Imap.list_Busy = BongoListDelete(Imap.list_Busy, session, FALSE);
XplSignalLocalSemaphore(Imap.sem_Busy);
if (session->progress) {