2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Try replacing CEvent with hsSemaphore.

This should work because we only ever call Wait() once. It doesn't fully
behave like Win32's manual reset events though, so if we had a more
complex usage that depended on the event remaining signalled, we'd have
a problem.
This commit is contained in:
Darryl Pogue
2012-03-10 14:16:01 -08:00
parent 3b39393077
commit 44a43b298b

View File

@ -120,7 +120,7 @@ bool gPendingActivate = false;
bool gPendingActivateFlag = false;
static bool s_loginDlgRunning = false;
static CEvent s_statusEvent(kEventManualReset);
static hsSemaphore s_statusEvent(0); // Start non-signalled
FILE *errFP = nil;
HINSTANCE gHInst = NULL; // Instance of this app
@ -1135,7 +1135,7 @@ void StatusCallback(void *param)
curl_easy_cleanup(hCurl);
delete [] statusUrl;
s_statusEvent.Signal();
s_statusEvent.Signal(); // Signal the semaphore
}
BOOL CALLBACK UruLoginDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
@ -1185,7 +1185,7 @@ BOOL CALLBACK UruLoginDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
case WM_DESTROY:
{
s_loginDlgRunning = false;
s_statusEvent.Wait(kEventWaitForever);
s_statusEvent.Wait();
KillTimer(hwndDlg, AUTH_LOGIN_TIMER);
return TRUE;
}