Changeset 47128d9 for owl.c


Ignore:
Timestamp:
May 23, 2011, 8:57:46 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
6bd485e
Parents:
1491439
git-author:
David Benjamin <davidben@mit.edu> (02/26/11 14:38:04)
git-committer:
David Benjamin <davidben@mit.edu> (05/23/11 20:57: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

    r1491439 r47128d9  
    362362  } else if (sig == SIGTERM || sig == SIGHUP) {
    363363    owl_function_quit();
    364   } else if (sig == SIGINT) {
     364  } else if (sig == SIGINT && owl_global_take_interrupt(&g)) {
    365365    owl_input in;
    366366    in.ch = in.uch = owl_global_get_startup_tio(&g)->c_cc[VINTR];
     
    374374  GSource *source;
    375375
    376   /* TODO: Special-case SIGINT so that it can interrupt outside the
    377    * event loop. */
    378 
     376  /* If it was an interrupt, set a flag so we can handle it earlier if
     377   * needbe. sig_handler_main_thread will check the flag to make sure
     378   * no one else took it. */
     379  if (sig == SIGINT) {
     380    owl_global_add_interrupt(&g);
     381  }
    379382  /* Send a message to the main thread. */
    380383  source = g_idle_source_new();
Note: See TracChangeset for help on using the changeset viewer.