summaryrefslogtreecommitdiff
path: root/src/time/timer_delete.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-03 12:08:34 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-03 12:08:34 -0400
commit6f1414e10297b75a58a92b678444fd277abc9a4f (patch)
tree2d013654908d7bcbced4036414c2c5890d50bad9 /src/time/timer_delete.c
parentf01d35184291c650f6a38f8b3da41693bfde0e70 (diff)
downloadmusl-6f1414e10297b75a58a92b678444fd277abc9a4f.tar.gz
revert to deleting kernel-level timer from cancellation handler
this is necessary in order to avoid breaking timer_getoverrun in the last run of the timer event handler, if it has not yet finished.
Diffstat (limited to 'src/time/timer_delete.c')
-rw-r--r--src/time/timer_delete.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/time/timer_delete.c b/src/time/timer_delete.c
index 437de2e0..7c82b183 100644
--- a/src/time/timer_delete.c
+++ b/src/time/timer_delete.c
@@ -3,11 +3,7 @@
int timer_delete(timer_t t)
{
- pthread_t td = 0;
- int r;
- if ((uintptr_t)t & 1) t = (void *)((unsigned long)t / 2);
- else td = t, t = td->result;
- r = __syscall(SYS_timer_delete, (long)t);
- if (td) pthread_cancel(td);
- return r;
+ if ((uintptr_t)t & 1)
+ return __syscall(SYS_timer_delete, ((unsigned long)t / 2));
+ return pthread_cancel(t);
}