| 300 | |
| 301 | |
| 302 | bool Clock::cancel(const Timer& timer) |
| 303 | { |
| 304 | bool canceled = false; |
| 305 | synchronized (timers_mutex) { |
| 306 | // Check if the timeout is still pending, and if so, erase it. In |
| 307 | // addition, erase an empty list if we just removed the last |
| 308 | // timeout. |
| 309 | Time time = timer.timeout().time(); |
| 310 | if (timers->count(time) > 0) { |
| 311 | canceled = true; |
| 312 | (*timers)[time].remove(timer); |
| 313 | if ((*timers)[time].empty()) { |
| 314 | timers->erase(time); |
| 315 | } |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | return canceled; |
| 320 | } |
| 321 | |
| 322 | |
| 323 | void Clock::pause() |
nothing calls this directly
no outgoing calls
no test coverage detected