diff options
Diffstat (limited to 'src/time/timer_delete.c')
-rw-r--r-- | src/time/timer_delete.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/time/timer_delete.c b/src/time/timer_delete.c new file mode 100644 index 00000000..d7c7670f --- /dev/null +++ b/src/time/timer_delete.c @@ -0,0 +1,12 @@ +#include <time.h> +#include "pthread_impl.h" + +int timer_delete(timer_t t) +{ + if (t->thread) pthread_cancel(t->thread); + else { + if (t->timerid >= 0) __syscall(SYS_timer_delete, t->timerid); + free(t); + } + return 0; +} |