Skip to content
Permalink
Browse files

core, bugfix: run microtask inside Fiber::scope.

  • Loading branch information...
xicilion committed Jun 30, 2018
1 parent 986703f commit 16b20f129c760291e7077ca58af6d961eece313d
Showing with 2 additions and 1 deletion.
  1. +2 −1 fibjs/src/coroutine/Fiber.cpp
@@ -71,7 +71,6 @@ void JSFiber::fiber_proc(void* p)
AsyncEvent* ae = (AsyncEvent*)isolate->m_jobs.getHead();

hr = ae->js_invoke();
isolate->m_isolate->RunMicrotasks();
}

isolate->Unref(hr);
@@ -224,6 +223,8 @@ JSFiber::scope::scope(JSFiber* fb)

JSFiber::scope::~scope()
{
m_pFiber->holder()->m_isolate->RunMicrotasks();

m_pFiber->m_quit.set();

ReportException(try_catch, m_hr);

0 comments on commit 16b20f1

Please sign in to comment.
You can’t perform that action at this time.