greatly improve SIGEV_THREAD timers

calling pthread_exit from, or pthread_cancel on, the timer callback
thread will no longer destroy the timer.
This commit is contained in:
Rich Felker 2011-04-09 02:23:33 -04:00
commit 82171d6ac0
3 changed files with 21 additions and 15 deletions

View file

@ -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);
}