mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-13 19:08:11 +00:00
[c-host] app: fix updateEvent race problem
This commit is contained in:
@@ -76,7 +76,7 @@ static bool dxgi_create()
|
||||
return false;
|
||||
}
|
||||
|
||||
this->copyEvent = os_createEvent();
|
||||
this->copyEvent = os_createEvent(true);
|
||||
if (!this->copyEvent)
|
||||
{
|
||||
DEBUG_ERROR("failed to create the copy event");
|
||||
|
@@ -300,9 +300,15 @@ bool os_joinThread(osThreadHandle * handle, int * resultCode)
|
||||
return false;
|
||||
}
|
||||
|
||||
osEventHandle * os_createEvent()
|
||||
osEventHandle * os_createEvent(bool autoReset)
|
||||
{
|
||||
HANDLE event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
HANDLE event = CreateEvent(NULL, autoReset ? FALSE : TRUE, FALSE, NULL);
|
||||
if (!event)
|
||||
{
|
||||
DEBUG_WINERROR("Failed to create the event", GetLastError());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (osEventHandle*)event;
|
||||
}
|
||||
|
||||
@@ -337,4 +343,9 @@ bool os_waitEvent(osEventHandle * handle)
|
||||
bool os_signalEvent(osEventHandle * handle)
|
||||
{
|
||||
return SetEvent((HANDLE)handle);
|
||||
}
|
||||
|
||||
bool os_resetEvent(osEventHandle * handle)
|
||||
{
|
||||
return ResetEvent((HANDLE)handle);
|
||||
}
|
Reference in New Issue
Block a user