synchronize ResetEvent as well
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4565 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
0c2333e69f
commit
10dbd9a196
1 changed files with 5 additions and 4 deletions
|
@ -46,7 +46,11 @@ BOOL SetEvent(HANDLE _event)
|
|||
BOOL ResetEvent(HANDLE _event)
|
||||
{
|
||||
evnet_t *event = (evnet_t *) _event;
|
||||
if (pthread_mutex_lock(&event->mutex))
|
||||
return FALSE;
|
||||
event->signaled = false;
|
||||
if (pthread_mutex_unlock(&event->mutex))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -79,10 +83,7 @@ DWORD WaitForSingleObject(HANDLE _event, DWORD) {
|
|||
pthread_mutex_unlock(&m);
|
||||
pthread_mutex_destroy(&m);
|
||||
}
|
||||
if (pthread_mutex_lock(&event->mutex))
|
||||
return !WAIT_OBJECT_0;
|
||||
event->signaled = false;
|
||||
if (pthread_mutex_unlock(&event->mutex))
|
||||
if (!ResetEvent(_event))
|
||||
return !WAIT_OBJECT_0;
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue