Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOJavaScriptEngine(WatchdogTimer) Category Reference

Instance Methods

(void) - watchdogTimerThread [implementation]
 

Detailed Description

Definition at line 186 of file OOJSEngineTimeManagement.m.

Method Documentation

◆ watchdogTimerThread

- (void) watchdogTimerThread
implementation

Extends class OOJavaScriptEngine.

Definition at line 591 of file OOJSEngineTimeManagement.m.

189{
190 for (;;)
191 {
192#if OOLITE_WINDOWS
193 Sleep(OOJS_TIME_LIMIT * 1000);
194#else
195 usleep(OOJS_TIME_LIMIT * 1000000);
196#endif
197
198 if (EXPECT(sLimiterStartDepth == 0 || sLimiterPauseDepth > 0)) continue; // Most of the time, a script isn't running.
199
200 // Note: if you add logging here, you need a manual autorelease pool.
201
205
206 if (EXPECT_NOT(elapsed > sLimiterTimeLimit))
207 {
208 sStop = YES;
209 JS_TriggerAllOperationCallbacks(_runtime);
210 }
211 }
212}
#define EXPECT_NOT(x)
#define EXPECT(x)
#define OOJS_TIME_LIMIT
static BOOL sStop
static double sLimiterTimeLimit
static int sLimiterPauseDepth
static unsigned sLimiterStartDepth
static OOHighResTimeValue sLimiterStart
OOTimeDelta OOHighResTimeDeltaInSeconds(OOHighResTimeValue startTime, OOHighResTimeValue endTime)
uint64_t OOHighResTimeValue
#define OOGetHighResTime
#define OODisposeHighResTime(time)
double OOTimeDelta
Definition OOTypes.h:224

The documentation for this category was generated from the following file: