diff --git a/src/node_platform.cc b/src/node_platform.cc index a8258ed74b120f..fdca115e5f8f03 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -141,6 +141,7 @@ void NodePlatform::RegisterIsolate(IsolateData* isolate_data, uv_loop_t* loop) { Mutex::ScopedLock lock(per_isolate_mutex_); std::shared_ptr existing = per_isolate_[isolate]; if (existing) { + CHECK_EQ(loop, existing->event_loop()); existing->ref(); } else { per_isolate_[isolate] = diff --git a/src/node_platform.h b/src/node_platform.h index cf0809ad1f673b..f6a177c9242324 100644 --- a/src/node_platform.h +++ b/src/node_platform.h @@ -72,6 +72,8 @@ class PerIsolatePlatformData : bool FlushForegroundTasksInternal(); void CancelPendingDelayedTasks(); + const uv_loop_t* event_loop() const { return loop_; } + private: void DeleteFromScheduledTasks(DelayedTask* task);