modified to test pthread_kill() to self and pthread_kill() to a blocked thread. nanosleep() can be interrupted and return the time remaining.