diff --git a/TimeoutGuard.cpp b/TimeoutGuard.cpp index a5a2be0..b987885 100644 --- a/TimeoutGuard.cpp +++ b/TimeoutGuard.cpp @@ -68,6 +68,12 @@ namespace utility wakeup.notify_all(); } + void TimeoutGuard::unwatch() { + touch(); + idle.store( true ); + wakeup.notify_all(); + } + void TimeoutGuard::touch() { touched.store( clock::now() ); diff --git a/TimeoutGuard.h b/TimeoutGuard.h index 3e2e6ce..fbc8eb4 100644 --- a/TimeoutGuard.h +++ b/TimeoutGuard.h @@ -46,6 +46,7 @@ namespace utility TimeoutGuard & operator=( TimeoutGuard && ) = delete; void watch(); + void unwatch(); void touch(); private: