5 -- Testing callbacks: the initial haskell thread calls out to C with
6 -- the address of a Haskell callback. The C function runs the callback
7 -- (in a new thread) and returns.
9 -- The stable pointer operation 'performIO' does the job of calling
10 -- the callback for us.
12 -- for an extra stressful test, the callback also does an explicit GC
13 -- to make sure that the original thread saved away its state
17 io <- makeStablePtr hello
18 _ccall_GC_ performIO io
24 putStr "hello world!\n"