Initial project import

This commit is contained in:
Agila Forge Importer committed 2026-07-13 15:20:32 +00:00
commit 23f2d29e32
11957 files changed
+1754577

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
@[has_globals]
module os
#flag -lpthread
fn C.pthread_self() usize
// g_main_thread_id and is_main_thread can be used to determine if the current thread is the main thread.
// if need to get the tid of the main thread, can use the global variable g_main_thread_id
// instead of using thread_id() every time.
__global g_main_thread_id = u64(C.pthread_self())
// is_main_thread returns whether the current thread is the main thread.
pub fn is_main_thread() bool {
return g_main_thread_id == u64(C.pthread_self())
}
fn signal_ignore_internal(_ ...Signal) {
// just do nothing by default, since that is most portable ¯\_(ツ)_/¯,
// especially on platforms like OpenBSD etc
}