MCPcopy Create free account
hub / github.com/apache/mesos / pause

Method pause

3rdparty/libprocess/src/clock.cpp:323–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321
322
323void Clock::pause()
324{
325 process::initialize(); // To make sure the event loop is ready.
326
327 synchronized (timers_mutex) {
328 if (!clock::paused) {
329 *clock::initial = *clock::current = now();
330 clock::paused = true;
331 VLOG(2) << "Clock paused at " << *clock::initial;
332
333 // When the clock is paused, we clear the scheduled 'ticks'
334 // since they no longer accurately represent when a 'tick'
335 // will fire (our notion of "time" is now moving differently
336 // from that of the event loop). Note that only 'ticks'
337 // that fire immediately will be scheduled while the clock
338 // is paused.
339 clock::ticks->clear();
340 }
341 }
342
343 // Note that after pausing the clock, the existing scheduled
344 // 'ticks' might still fire, but since 'paused' == true no "time"
345 // will actually have passed, so no timer will actually fire.
346}
347
348
349bool Clock::paused()

Callers

nothing calls this directly

Calls 1

initializeFunction · 0.70

Tested by

no test coverage detected