unix: req queue must be empty when destroying loop

Assert that the request queue is empty when destroying the event loop.

Should catch errors where people call uv_loop_delete() when there are
still in-progress work requests (for example.)
This commit is contained in:
Ben Noordhuis 2013-08-27 14:26:41 +02:00
parent b647c27b02
commit 3f2d4d5358

View File

@ -101,6 +101,7 @@ void uv__loop_delete(uv_loop_t* loop) {
uv_mutex_lock(&loop->wq_mutex);
assert(QUEUE_EMPTY(&loop->wq) && "thread pool work queue not empty!");
assert(!uv__has_active_reqs(loop));
uv_mutex_unlock(&loop->wq_mutex);
uv_mutex_destroy(&loop->wq_mutex);