Oolite 1.91.0.7668-250429-8542c40
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
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 188 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

References EXPECT, EXPECT_NOT, OODisposeHighResTime, OOGetHighResTime, OOHighResTimeDeltaInSeconds(), OOJS_TIME_LIMIT, sLimiterPauseDepth, sLimiterStart, sLimiterStartDepth, sLimiterTimeLimit, sStop, and watchdogTimerThread.

Referenced by watchdogTimerThread.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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