diff options
| author | Jan Djärv | 2008-04-09 06:46:02 +0000 |
|---|---|---|
| committer | Jan Djärv | 2008-04-09 06:46:02 +0000 |
| commit | 170c80bed42b58e346befd5b8c6f73a5b9d047b7 (patch) | |
| tree | 97a0b4aabea53705cb4ac586a0461500cc668016 /src | |
| parent | 799224fe61c0e65c9d0ac2107ec8eed8d898c679 (diff) | |
| download | emacs-170c80bed42b58e346befd5b8c6f73a5b9d047b7.tar.gz emacs-170c80bed42b58e346befd5b8c6f73a5b9d047b7.zip | |
(alarm_signal_handler): Call run_timers if not SYNC_INPUT.
Most of the code moved to run_timers.
(do_pending_atimers): Call run_timers.
(run_timers): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/atimer.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/atimer.c b/src/atimer.c index f5f5f34f16a..fc7aeb01010 100644 --- a/src/atimer.c +++ b/src/atimer.c | |||
| @@ -355,20 +355,12 @@ schedule_atimer (t) | |||
| 355 | t->next = a; | 355 | t->next = a; |
| 356 | } | 356 | } |
| 357 | 357 | ||
| 358 | 358 | static void | |
| 359 | /* Signal handler for SIGALRM. SIGNO is the signal number, i.e. | 359 | run_timers () |
| 360 | SIGALRM. */ | ||
| 361 | |||
| 362 | SIGTYPE | ||
| 363 | alarm_signal_handler (signo) | ||
| 364 | int signo; | ||
| 365 | { | 360 | { |
| 366 | EMACS_TIME now; | 361 | EMACS_TIME now; |
| 367 | 362 | ||
| 368 | SIGNAL_THREAD_CHECK (signo); | ||
| 369 | |||
| 370 | EMACS_GET_TIME (now); | 363 | EMACS_GET_TIME (now); |
| 371 | pending_atimers = 0; | ||
| 372 | 364 | ||
| 373 | while (atimers | 365 | while (atimers |
| 374 | && (pending_atimers = interrupt_input_blocked) == 0 | 366 | && (pending_atimers = interrupt_input_blocked) == 0 |
| @@ -405,6 +397,20 @@ alarm_signal_handler (signo) | |||
| 405 | } | 397 | } |
| 406 | 398 | ||
| 407 | 399 | ||
| 400 | /* Signal handler for SIGALRM. SIGNO is the signal number, i.e. | ||
| 401 | SIGALRM. */ | ||
| 402 | |||
| 403 | SIGTYPE | ||
| 404 | alarm_signal_handler (signo) | ||
| 405 | int signo; | ||
| 406 | { | ||
| 407 | pending_atimers = 1; | ||
| 408 | #ifndef SYNC_INPUT | ||
| 409 | run_timers (); | ||
| 410 | #endif | ||
| 411 | } | ||
| 412 | |||
| 413 | |||
| 408 | /* Call alarm_signal_handler for pending timers. */ | 414 | /* Call alarm_signal_handler for pending timers. */ |
| 409 | 415 | ||
| 410 | void | 416 | void |
| @@ -413,7 +419,7 @@ do_pending_atimers () | |||
| 413 | if (pending_atimers) | 419 | if (pending_atimers) |
| 414 | { | 420 | { |
| 415 | BLOCK_ATIMERS; | 421 | BLOCK_ATIMERS; |
| 416 | alarm_signal_handler (SIGALRM); | 422 | run_timers (); |
| 417 | UNBLOCK_ATIMERS; | 423 | UNBLOCK_ATIMERS; |
| 418 | } | 424 | } |
| 419 | } | 425 | } |