fixed pthread_join() when using signals, new example