# HG changeset patch # User John W. Eaton # Date 1385344888 18000 # Sun Nov 24 21:01:28 2013 -0500 # Node ID 2549b72fa0612f430a67c5f3f368daec803f23ab # Parent d7d7f1864887aefa62b70b46ebf71d8179999d42 allow calls to the system function to be interrupted (bug #37672) * thread-manager.cc (pthead_thread_manager::interrupt): Use kill to generate signal instead of pthread_kill. diff --git a/libgui/src/thread-manager.cc b/libgui/src/thread-manager.cc --- a/libgui/src/thread-manager.cc +++ b/libgui/src/thread-manager.cc @@ -71,7 +71,20 @@ void interrupt (void) { if (initialized) - pthread_kill (my_thread, SIGINT); + { + // Send SIGINT to all other processes in our process group. + // This is needed to interrupt calls to system (), for example. + + // FIXME: what happens if some code inside a + // {BEGIN,END}_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE block + // starts additional threads and one of those happens to catch + // this signal? Then would the interrupt handler and the + // subsequent longjmp and exception all be executed in the wrong + // thread? If so, is there any way to prevent that from + // happening? + + kill (0, SIGINT); + } } private: