version 1.8, 2015/09/04 12:02:44 |
version 1.9, 2015/09/13 10:45:55 |
|
|
void |
void |
cmd_wait_for_remove(struct wait_channel *wc) |
cmd_wait_for_remove(struct wait_channel *wc) |
{ |
{ |
|
|
if (wc->locked) |
if (wc->locked) |
return; |
return; |
if (!TAILQ_EMPTY(&wc->waiters) || !wc->woken) |
if (!TAILQ_EMPTY(&wc->waiters) || !wc->woken) |
|
|
if (!cmdq_free(wq)) |
if (!cmdq_free(wq)) |
cmdq_continue(wq); |
cmdq_continue(wq); |
} |
} |
while ((wq = TAILQ_FIRST(&wc->lockers)) != NULL) { |
wc->woken = 1; |
|
TAILQ_FOREACH_SAFE(wq, &wc->lockers, waitentry, wq1) { |
TAILQ_REMOVE(&wc->lockers, wq, waitentry); |
TAILQ_REMOVE(&wc->lockers, wq, waitentry); |
if (!cmdq_free(wq)) |
if (!cmdq_free(wq)) |
cmdq_continue(wq); |
cmdq_continue(wq); |