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

Function synchronized

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

Source from the content-addressed store, hash-verified

144 list<Timer> timedout;
145
146 synchronized (timers_mutex) {
147 // We pass nullptr to be explicit about the fact that we want the
148 // global clock time, even though it's unnecessary ('tick' is
149 // called from the event loop, not a Process context).
150 Time now = Clock::now(nullptr);
151
152 VLOG(3) << "Handling timers up to " << now;
153
154 foreachkey (const Time& timeout, *timers) {
155 if (timeout > now) {
156 break;
157 }
158
159 VLOG(3) << "Have timeout(s) at " << timeout;
160
161 // Need to toggle 'settling' so that we don't prematurely say
162 // we're settled until after the timers are executed below,
163 // outside of the critical section.
164 if (clock::paused) {
165 clock::settling = true;
166 }
167
168 timedout.splice(timedout.end(), (*timers)[timeout]);
169 }
170
171 // Now erase the range of timers that timed out.
172 timers->erase(timers->begin(), timers->upper_bound(now));
173
174 // Okay, so the timeout for the next timer should not have fired.
175 CHECK(timers->empty() || (timers->begin()->first > now));
176
177 // Remove this tick from the scheduled 'ticks', it may have
178 // been removed already if the clock was paused / manipulated
179 // in the interim.
180 ticks->erase(time);
181
182 // Schedule another "tick" if necessary.
183 scheduleTick(*timers, ticks);
184 }
185
186 (*clock::callback)(timedout);
187

Callers 15

readMethod · 0.70
closeMethod · 0.70
writeMethod · 0.70
failMethod · 0.70
startMethod · 0.50
write_lockMethod · 0.50
write_unlockMethod · 0.50
read_lockMethod · 0.50
read_unlockMethod · 0.50
lockMethod · 0.50
unlockMethod · 0.50
FutureHttpRequestFunction · 0.50

Calls 12

scheduleTickFunction · 0.85
TimeClass · 0.50
eraseMethod · 0.45
beginMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
countMethod · 0.45
timeMethod · 0.45
timeoutMethod · 0.45
removeMethod · 0.45
selfMethod · 0.45

Tested by

no test coverage detected