reorder timer initialization so that timer_create does not depend on free
[musl] / src / time / timer_delete.c
1 #include <time.h>
2 #include "pthread_impl.h"
3
4 int timer_delete(timer_t t)
5 {
6         if (t->thread) pthread_cancel(t->thread);
7         else {
8                 __syscall(SYS_timer_delete, t->timerid);
9                 free(t);
10         }
11         return 0;
12 }