De-singleton-ify the watchdog timer.

This commit is contained in:
David Anderson
2015-02-24 01:53:37 -08:00
parent 3cf3f6c3f8
commit 57ba8fd09b
7 changed files with 25 additions and 9 deletions
+2 -1
View File
@@ -37,6 +37,7 @@
#include "../sp_vm_basecontext.h"
#include "watchdog_timer.h"
#include "interpreter.h"
#include "environment.h"
using namespace sp;
using namespace Knight;
@@ -274,7 +275,7 @@ CompileFromThunk(PluginRuntime *runtime, cell_t pcode_offs, void **addrp, char *
// If the watchdog timer has declared a timeout, we must process it now,
// and possibly refuse to compile, since otherwise we will compile a
// function that is not patched for timeouts.
if (!g_WatchdogTimer.HandleInterrupt())
if (!Environment::get()->watchdog()->HandleInterrupt())
return SP_ERROR_TIMEOUT;
CompiledFunction *fn = runtime->GetJittedFunctionByOffset(pcode_offs);