v2 / vlib / os / signal_windows.c.v
18 lines · 14 sloc · 618 bytes · 791d0d30ea54bf564573fbb801def32b6214ee38
Raw
1@[has_globals]
2module os
3
4fn C.GetCurrentThreadId() u32
5
6// g_main_thread_id and is_main_thread can be used to determine if the current thread is the main thread.
7// if need to get the tid of the main thread, can use the global variable g_main_thread_id
8// instead of using thread_id() every time.
9__global g_main_thread_id = u64(C.GetCurrentThreadId())
10
11// is_main_thread returns whether the current thread is the main thread.
12pub fn is_main_thread() bool {
13 return g_main_thread_id == u64(C.GetCurrentThreadId())
14}
15
16// The windows platform does not need to be handled.
17fn signal_ignore_internal(_args ...Signal) {
18}
19