- list = &q->task_list;
- seen = 0;
- retval = -1;
-
- do {
- struct list_head *next;
- if (list == &wait->task_list)
- seen++;
- next = list->next;
- if (next->prev != list) {
- seen += 2;
- break;
- }
- list = next;
- } while (list != &q->task_list);
-
- if (seen == 1) {
- __remove_wait_queue(q, wait);
- retval = 0;
- }