- Timestamp:
- May 23, 2011, 8:57:46 PM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- e2cc848
- Parents:
- 257b9c4
- git-author:
- David Benjamin <davidben@mit.edu> (02/26/11 14:11:26)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/23/11 20:57:46)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
r3535a6e r81db142 354 354 } 355 355 356 static void sig_handler(int sig, void *data) { 356 static gboolean sig_handler_main_thread(gpointer data) { 357 int sig = GPOINTER_TO_INT(data); 358 357 359 owl_function_debugmsg("Got signal %d", sig); 358 360 /* TODO: These don't need to be re-entrant anymore! */ … … 372 374 owl_process_input_char(in); 373 375 } 376 return FALSE; 377 } 378 379 static void sig_handler(int sig, void *data) { 380 GMainContext *context = data; 381 GSource *source; 382 383 /* TODO: Special-case SIGINT so that it can interrupt outside the 384 * event loop. */ 385 386 /* Send a message to the main thread. */ 387 source = g_idle_source_new(); 388 g_source_set_priority(source, G_PRIORITY_DEFAULT); 389 g_source_set_callback(source, sig_handler_main_thread, 390 GINT_TO_POINTER(sig), NULL); 391 g_source_attach(source, context); 392 g_source_unref(source); 374 393 } 375 394 … … 385 404 sigaddset(&sigset, SIGINT); 386 405 387 owl_signal_init(&sigset, sig_handler, NULL);406 owl_signal_init(&sigset, sig_handler, g_main_context_default()); 388 407 } 389 408
Note: See TracChangeset
for help on using the changeset viewer.