Skip to content
Permalink
Browse files

timers, feat: not interrupt script when hr_timer is stopped.

  • Loading branch information...
xicilion committed Aug 14, 2018
1 parent b68cfd5 commit 05e79951ef5bed69e16e1f5f5aba1d4f74ac6931
Showing with 8 additions and 0 deletions.
  1. +8 −0 fibjs/include/Timer.h
@@ -68,6 +68,11 @@ class Timer : public Timer_base,
resume();
}

bool is_stopped()
{
return m_cancel != 0;
}

public:
virtual void on_timer()
{
@@ -143,6 +148,9 @@ class JSTimer : public Timer {
{
Isolate* isolate = holder();

if (is_stopped())
m_hr = false;

if (m_hr)
isolate->RequestInterrupt(_InterruptCallback, this);
else

0 comments on commit 05e7995

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