diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-04-09 02:23:33 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-04-09 02:23:33 -0400 |
commit | 82171d6ac0d84876cdc6dd6319b0790b42cdb47e (patch) | |
tree | df557d7e26c757b333c3dc1e4a9338113d91446e /src/time/timer_delete.c | |
parent | 2d1d62ed47452126bb632207dd64b0fdaf4c13ed (diff) | |
download | musl-82171d6ac0d84876cdc6dd6319b0790b42cdb47e.tar.gz musl-82171d6ac0d84876cdc6dd6319b0790b42cdb47e.tar.bz2 musl-82171d6ac0d84876cdc6dd6319b0790b42cdb47e.tar.xz musl-82171d6ac0d84876cdc6dd6319b0790b42cdb47e.zip |
greatly improve SIGEV_THREAD timers
calling pthread_exit from, or pthread_cancel on, the timer callback
thread will no longer destroy the timer.
Diffstat (limited to 'src/time/timer_delete.c')
-rw-r--r-- | src/time/timer_delete.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/time/timer_delete.c b/src/time/timer_delete.c index f05b27d5..b5f8ca19 100644 --- a/src/time/timer_delete.c +++ b/src/time/timer_delete.c @@ -3,6 +3,11 @@ int timer_delete(timer_t t) { - if ((uintptr_t)t >= 0x100000) return pthread_cancel(t); + if ((uintptr_t)t >= 0x100000) { + pthread_t td = t; + td->delete_timer = 1; + __wake(&td->delete_timer, 1, 1); + return 0; + } return __syscall(SYS_timer_delete, (long)t); } |