Commit 55e9481
Gabriel Schulhof
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: Gabriel Schulhof <gabriel.schulhof@intel.com>1 parent 38bf1be commit 55e9481
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
| |||
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
132 | | - | |
| 141 | + | |
133 | 142 | | |
134 | 143 | | |
135 | 144 | | |
| |||
149 | 158 | | |
150 | 159 | | |
151 | 160 | | |
152 | | - | |
| 161 | + | |
153 | 162 | | |
154 | 163 | | |
155 | 164 | | |
| |||
0 commit comments