diff options
Diffstat (limited to 'src/platform/windows/win_thread.c')
| -rw-r--r-- | src/platform/windows/win_thread.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/platform/windows/win_thread.c b/src/platform/windows/win_thread.c index a2ae72fe..2e9d58d7 100644 --- a/src/platform/windows/win_thread.c +++ b/src/platform/windows/win_thread.c @@ -107,6 +107,7 @@ static unsigned int __stdcall nni_plat_thr_main(void *arg) { nni_plat_thr *thr = arg; + thr->id = GetCurrentThreadId(); thr->func(thr->arg); return (0); } @@ -138,6 +139,12 @@ nni_plat_thr_fini(nni_plat_thr *thr) } } +bool +nni_plat_thr_is_self(nni_plat_thr *thr) +{ + return (GetCurrentThreadId() == thr->id); +} + static LONG plat_inited = 0; int |
