-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Expected behavior
When on a Timer object cancel() is called and the object is deleted immediately afterwards, the object's destructor should return.
Actual behavior
Dependent on scheduler behavior, constructor returns or is stuck at _thread.join();
Steps to reproduce the problem
When calling cancel() and deleting the Timer object immediately afterwards, first CancelNotification is enqueued by cancel() and afterwards StopNotification is enqueued by ~Timer(). If inbetween there was no rescheduling to the Timer's thread, the following happens, once the thread is running again:
Due to the execution of CancelNotification the _queue is being cleared, so the StopNotification is being deleted without being executed. As a result, the thread's while loop is not left and _thread.join(); in ~Timer() is blocking forever.
POCO version
1.7.2
Compiler and version
Visual Studio 2015
Operating system and version
Windows 7 Build 7601