Skip to content

Commit

Permalink
core, bugfix: run microtask inside Fiber::scope.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Jun 30, 2018
1 parent 986703f commit 16b20f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fibjs/src/coroutine/Fiber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 16b20f1

Please sign in to comment.