| 12 | } |
| 13 | |
| 14 | bool AsyncTimer::setTimeIfNotSet( const std::chrono::time_point<std::chrono::system_clock> & time ) |
| 15 | { |
| 16 | std::unique_lock lock( mutex_ ); |
| 17 | if ( !time_ ) |
| 18 | { |
| 19 | time_ = time; |
| 20 | cvar_.notify_one(); |
| 21 | return true; |
| 22 | } |
| 23 | return false; |
| 24 | } |
| 25 | |
| 26 | void AsyncTimer::resetTime() |
| 27 | { |