Interrupted system call and signal handler trouble

Started by
0 comments, last by smokes 21 years ago
I have a two threaded app. The main thread and a worker. I''ve installed a signal handler to catch SIGINT (CTRL+C) and SIGTERM to shutdown the app. My worker thread is checking a bool (protected by a mutex) to determine if it is time to shutdown, in every iteration of its main loop. The problem is that if I invoke the signal handler when the worker thread is calling select() it returns with System call interupted. First of all, when the system call is carryied out in another thread than the one which install the signal handler, why is the system call then interrupted?!? Secondly what causes pthread_join to exit with the error Illegal seek ?!?
Advertisement
come on people someone must have implemented a signal handler in a multithreaded app :-)

This topic is closed to new replies.

Advertisement