Changeset 37d188f for owl.c


Ignore:
Timestamp:
Mar 25, 2011, 3:46:46 AM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Children:
0af5f9d
Parents:
87833a8
git-author:
David Benjamin <davidben@mit.edu> (02/26/11 14:38:04)
git-committer:
David Benjamin <davidben@mit.edu> (03/25/11 03:46:46)
Message:
Allow interrupts to be taken at any point

This way we can catch SIGINT in the middle of a search if we care.
(Though ideally we wouldn't block the event loop when searching like
this.)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r87833a8 r37d188f  
    369369  } else if (sig == SIGTERM || sig == SIGHUP) {
    370370    owl_function_quit();
    371   } else if (sig == SIGINT) {
     371  } else if (sig == SIGINT && owl_global_take_interrupt(&g)) {
    372372    owl_input in;
    373373    in.ch = in.uch = owl_global_get_startup_tio(&g)->c_cc[VINTR];
     
    381381  GSource *source;
    382382
    383   /* TODO: Special-case SIGINT so that it can interrupt outside the
    384    * event loop. */
    385 
     383  /* If it was an interrupt, set a flag so we can handle it earlier if
     384   * needbe. sig_handler_main_thread will check the flag to make sure
     385   * no one else took it. */
     386  if (sig == SIGINT) {
     387    owl_global_add_interrupt(&g);
     388  }
    386389  /* Send a message to the main thread. */
    387390  source = g_idle_source_new();
Note: See TracChangeset for help on using the changeset viewer.