add Timer::close()
An aid to orderly shutdown
This commit is contained in:
@@ -160,8 +160,14 @@ void Timer::run()
|
||||
}
|
||||
|
||||
Timer::~Timer() {
|
||||
close();
|
||||
}
|
||||
|
||||
void Timer::close() {
|
||||
{
|
||||
Lock xx(mutex);
|
||||
if(!alive)
|
||||
return; // already closed
|
||||
alive = false;
|
||||
}
|
||||
waitForWork.signal();
|
||||
|
||||
Reference in New Issue
Block a user