mirror of
https://github.com/odin-lang/Odin.git
synced 2026-11-06 10:43:22 -05:00
21 lines
484 B
Odin
21 lines
484 B
Odin
#+build linux
|
|
#+private
|
|
package thread
|
|
|
|
import "core:sys/posix"
|
|
import "core:c"
|
|
|
|
_MAX_PTHREAD_NAME_LENGTH :: 16
|
|
|
|
when ODIN_PLATFORM_SUBTARGET == .Android {
|
|
// Bionic keeps pthreads in libc.
|
|
foreign import pthread "system:c"
|
|
} else {
|
|
foreign import pthread "system:pthread"
|
|
}
|
|
|
|
foreign pthread {
|
|
pthread_getname_np :: proc(thread: posix.pthread_t, name: [^]u8, len: c.size_t) -> posix.Errno ---
|
|
pthread_setname_np :: proc(thread: posix.pthread_t, name: [^]u8) -> posix.Errno ---
|
|
}
|