mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 01:21:38 -07:00
f798f0b446
This is needed for the docs generator to generate all the docs for the posix package, if it is imported like it was on Windows it would generate docs for the Windows version of the package which has much less symbols exposed.
23 lines
587 B
Odin
23 lines
587 B
Odin
#+build linux, darwin, netbsd, openbsd, freebsd
|
|
#+private
|
|
package testing
|
|
|
|
import "core:c/libc"
|
|
import "core:sys/posix"
|
|
|
|
__setup_signal_handler :: proc() {
|
|
libc.signal(posix.SIGTRAP, stop_test_callback)
|
|
}
|
|
|
|
_test_thread_cancel :: proc "contextless" () {
|
|
// NOTE(Feoramund): Some UNIX-like platforms may require this.
|
|
//
|
|
// During testing, I found that NetBSD 10.0 refused to
|
|
// terminate a task thread, even when its thread had been
|
|
// properly set to PTHREAD_CANCEL_ASYNCHRONOUS.
|
|
//
|
|
// The runner would stall after returning from `pthread_cancel`.
|
|
|
|
posix.pthread_testcancel()
|
|
}
|