summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib-systhreads/test_c_thread_register.ml
blob: a8ec98aa9a7d62345a1103aa4a527f3921437cae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(* TEST
   modules = "test_c_thread_register_cstubs.c"
   * hassysthreads
   include systhreads
   ** not-bsd
   *** bytecode
   *** native
*)

(* spins a external thread from C and register it to the OCaml runtime *)

external spawn_thread : (unit -> unit) -> unit = "spawn_thread"

let passed () = Printf.printf "passed\n"

let _ =
  spawn_thread (passed);
  Thread.delay 0.5