blob: f77aaf81c2d62d4611314035d3ddfa743def5056 (
plain)
1
2
3
4
5
6
7
8
9
10
|
use libc::{c_long, getpid, syscall, SYS_gettid};
pub fn is_main_thread() -> bool
{
let ttid = unsafe { syscall(SYS_gettid) };
let pid = c_long::from(unsafe { getpid() });
ttid == pid
}
|