MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / start

Method start

src/yvalve/MasterImplementation.cpp:330–367  ·  view source on GitHub ↗

ITimerControl implementation

Source from the content-addressed store, hash-verified

328public:
329 // ITimerControl implementation
330 void start(CheckStatusWrapper* status, ITimer* timer, ISC_UINT64 microSeconds)
331 {
332 try
333 {
334 MutexLockGuard guard(timerAccess, FB_FUNCTION);
335
336 if (stopTimerThread.value() != 0)
337 {
338 // Ignore an attempt to start timer - anyway thread to make it fire is down
339
340 // We must leave timerAccess mutex here to avoid deadlocks
341 MutexUnlockGuard ug(timerAccess, FB_FUNCTION);
342
343 timer->addRef();
344 timer->release();
345 return;
346 }
347
348 timerHolder.init();
349
350 TimerEntry* curTimer = getTimer(timer);
351 if (curTimer)
352 timerQueue->remove(curTimer);
353 else
354 timer->addRef();
355
356 TimerEntry newTimer;
357 newTimer.timer = timer;
358 newTimer.fireTime = curTime() + microSeconds;
359 timerQueue->add(newTimer);
360
361 timerWakeup->release();
362 }
363 catch (const Firebird::Exception& ex)
364 {
365 ex.stuffException(status);
366 }
367 }
368
369 void stop(CheckStatusWrapper* status, ITimer* timer)
370 {

Callers

nothing calls this directly

Calls 9

getTimerFunction · 0.85
curTimeFunction · 0.85
valueMethod · 0.45
addRefMethod · 0.45
releaseMethod · 0.45
initMethod · 0.45
removeMethod · 0.45
addMethod · 0.45
stuffExceptionMethod · 0.45

Tested by

no test coverage detected