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:
parent
2d1d62ed47
commit
82171d6ac0
3 changed files with 21 additions and 15 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue