Browse Source

Fix thread init on windows

pull/6/head
Aleksey Demakov 7 years ago
parent
commit
bdd7a8886b
  1. 6
      ChangeLog
  2. 2
      jit/jit-thread.c

6
ChangeLog

@ -1,4 +1,8 @@
2017-10-01 Jakob Löw <jakob@m4gnus.de>
2017-10-02 Ketmar Dark <ketmar@ketmar.no-ip.org>
* jit/jit-thread.c (_jit_thread_init): fix thread init on windows.
2017-10-01 Jakob Löw <jakob@m4gnus.de>
* jit/jit-gen-x86-64.h: add the movlhps and movhlps instructions
* jit/jit-rules-x86-64.ins

2
jit/jit-thread.c

@ -104,7 +104,7 @@ void _jit_thread_init(void)
pthread_once(&once_control, init_pthread);
#elif defined(JIT_THREADS_WIN32)
static LONG volatile once_control = 0;
switch(InterlockedExchange(&once_control, 1))
switch(InterlockedCompareExchange(&once_control, 1, 0))
{
case 0:
init_win32_thread();

Loading…
Cancel
Save