n-api: fix win32 main thread detection
uv_thread_self()
works on Windows only for threads created using
uv_thread_start()
because libuv does not use GetCurrentThreadId()
for threads that were created otherwise. uv_thread_equal()
works
correctly.
Thus, on Windows we use GetCurrentThreadId()
to compare the main
thread with the current thread.
Signed-off-by: @gabrielschulhof
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines