\
BUG_ON(_i >= (h)->used); \
(h)->used--; \
- heap_swap(h, _i, (h)->used); \
- heap_sift_down(h, _i, cmp); \
- heap_sift(h, _i, cmp); \
+ if ((_i) < (h)->used) { \
+ heap_swap(h, _i, (h)->used); \
+ heap_sift_down(h, _i, cmp); \
+ heap_sift(h, _i, cmp); \
+ } \
} while (0)
#define heap_pop(h, d, cmp) \
__attribute__((destructor(103)))
static void timers_cleanup(void)
{
+ get_task_struct(timer_task);
+
pthread_mutex_lock(&timer_lock);
timer_thread_stop = true;
pthread_cond_signal(&timer_cond);
int ret = kthread_stop(timer_task);
BUG_ON(ret);
+ put_task_struct(timer_task);
timer_task = NULL;
}