I've done some more research and programming. My threads now respond to an exit() correctly and clean up, but I would still like to stop a SIGINT from calling exit().
If I run my code in gdb, and trigger a SIGINT, the signal handler jumps straight to libatiocl64.so
#0 0x00007fffe3636ef0 in ?? () from /usr/lib/libatiocl64.so
#1 <signal handler called>
....
So I ran strace to find when the signal handler is registered by the library, but I cannot find it. I tried setting a new signal handler periodically and it still won't use my signal handler. My handler works great however if I don't boot the OpenCL part of the code.
I'm guessing it's registered in some unusual manner?
I would like to register my own handler for SIGINT, any clues on how I can do this?