Files
Odin/core/testing/signal_handler_posix.odin
Ignacy Koper c01e85ca67 removed core:sys/haiku package
also removes Haiku from core:sys/info, core:os/old, core:path/filepath, core:dynlib, core:time, core:testing, and core:terminal (minor changes)

Signed-off-by: Ignacy Koper <ignacy423@gmail.com>
2026-04-28 19:27:24 +02:00

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()
}