1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Get rid of CCritSect in the patcher stuff.

This commit is contained in:
Darryl Pogue
2012-03-10 20:33:26 -08:00
parent a28213806f
commit 833124c297
2 changed files with 8 additions and 8 deletions

View File

@ -149,7 +149,7 @@ static HANDLE s_event;
static HINSTANCE s_hInstance;
static HWND s_dialog;
static hsSemaphore s_dialogCreateEvent(0);
static CCritSect s_critsect;
static hsMutex s_critsect;
static LISTDECL(WndEvent, link) s_eventQ;
static hsSemaphore s_shutdownEvent(0);
static wchar_t s_workingDir[MAX_PATH];
@ -197,9 +197,9 @@ static void Abort () {
//============================================================================
static void PostEvent (WndEvent *event) {
s_critsect.Enter();
s_critsect.Lock();
s_eventQ.Link(event);
s_critsect.Leave();
s_critsect.Unlock();
}
//============================================================================
@ -394,11 +394,11 @@ static void Recv_SetBytesRemaining (HWND hwnd, const SetBytesRemainingEvent &eve
static void DispatchEvents (HWND hwnd) {
LISTDECL(WndEvent, link) eventQ;
s_critsect.Enter();
s_critsect.Lock();
{
eventQ.Link(&s_eventQ);
}
s_critsect.Leave();
s_critsect.Unlock();
#define DISPATCH(a) case kEvent##a: Recv_##a(hwnd, *(const a##Event *) event); break
while (WndEvent *event = eventQ.Head()) {