Skip to content

Commit

Permalink
mem: init g_memLock directly (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh authored Apr 30, 2022
1 parent 8effd3e commit b653bb6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mem/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ static BOOL CALLBACK InitHandleFunction(PINIT_ONCE initOnce,
{
(void)initOnce;
(void)parameter;
(void)lpContext;

InitializeCriticalSection((LPCRITICAL_SECTION)lpContext);
InitializeCriticalSection(&g_memLock);

return TRUE;
}
Expand All @@ -88,7 +89,7 @@ static BOOL CALLBACK InitHandleFunction(PINIT_ONCE initOnce,
static inline void mem_lock(void)
{
InitOnceExecuteOnce(&g_initMemLockOnce, InitHandleFunction,
NULL, (PVOID*)&g_memLock);
NULL, NULL);
EnterCriticalSection(&g_memLock);
}

Expand Down

0 comments on commit b653bb6

Please sign in to comment.