/* This prevents waiter starvation where an exclusive waiter aborts and is woken up concurrently and noone wakes up the next waiter.  */
void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key)
/* This prevents waiter starvation where an exclusive waiter aborts and is woken up concurrently and noone wakes up the next waiter.  */
void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key)
{
	unsigned long flags;
	__set_current_state(TASK_RUNNING);
	spin_lock_irqsave(&q->lock, flags);
	if (!list_empty(&wait->task_list))
		list_del_init(&wait->task_list);
	else if (waitqueue_active(q))
		__wake_up_locked_key(q, mode, key);
	spin_unlock_irqrestore(&q->lock, flags);
}