On linux, if you use semaphores. The GC sends SIGUSR1 & SIGUSR2 to all threads for pausing and resuming. The semaphores will wake up with error EINTR. You only have to check for that, and wait again.