From 3f2d4d535867a99170b4964f2e3db1ef70968c23 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 27 Aug 2013 14:26:41 +0200 Subject: [PATCH] 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.) --- src/unix/loop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/unix/loop.c b/src/unix/loop.c index 1ed5b8de..1177b9fe 100644 --- a/src/unix/loop.c +++ b/src/unix/loop.c @@ -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);