From 553c6eafd3592ffc19fff8d3abb8e509879e6068 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Wed, 7 Sep 2016 01:25:47 +0200 Subject: [PATCH] async: remove racey `uv_ref()`/`uv_unref()` `uv_ref()` can't be called from the non-event-loop thread. Furthermore, it is not necessary in `async.h`, because open `uv_async_t` is already holding the event loop from exiting. See: #702 --- src/async.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/async.h b/src/async.h index 2b167cec2..5232c127d 100644 --- a/src/async.h +++ b/src/async.h @@ -36,11 +36,6 @@ template class Async { rows.swap(async->data); NODE_SQLITE3_MUTEX_UNLOCK(&async->mutex) for (unsigned int i = 0, size = rows.size(); i < size; i++) { -#if NODE_VERSION_AT_LEAST(0, 7, 9) - uv_unref((uv_handle_t *)&async->watcher); -#else - uv_unref(uv_default_loop()); -#endif async->callback(async->parent, rows[i]); } } @@ -61,12 +56,6 @@ template class Async { } void add(Item* item) { - // Make sure node runs long enough to deliver the messages. -#if NODE_VERSION_AT_LEAST(0, 7, 9) - uv_ref((uv_handle_t *)&watcher); -#else - uv_ref(uv_default_loop()); -#endif NODE_SQLITE3_MUTEX_LOCK(&mutex); data.push_back(item); NODE_SQLITE3_MUTEX_UNLOCK(&mutex)