Fix dead lock on Timer destructor (#3987)

Consider following situation. A class owns a timer. In destructor of that class we call .cancel() asynchronous on timer before it's destruction.
Now timer is executing cancel in it's own internal thread, while it's doing that destructor of timer is called from owning class. Timer destructor enqueues stop notification. If that enqueue is happening just after while loop from cancel notification, stop notification is gonna be dropped and timer will never stop.

fixes #3986

Co-authored-by: Vojin Ilic <vilic@nvidia.com>
This commit is contained in:
vojinilic 2023-03-30 12:46:03 +02:00 committed by GitHub
parent 4cc956483d
commit 39a8b9a7c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,7 +101,6 @@ public:
pNf = static_cast<TimerNotification*>(queue().dequeueNotification());
}
queue().clear();
_finished.set();
return true;
}