[KBM] Moved unregistering of key delays to always run on the dispatcher thread to avoid mutex re-entrancy (#6959)

* Moved unregistering of key delays to always run on the dispatcher thread

* Updated comments
This commit is contained in:
Arjun Balgovind
2020-10-01 18:19:11 -07:00
committed by GitHub
parent 55fd8749c8
commit b2e72e1ca4
3 changed files with 53 additions and 42 deletions

View File

@@ -1,6 +1,7 @@
#include "pch.h"
#include "KeyDelay.h"
// NOTE: The destructor should never be called on the DelayThread, i.e. from any of shortPress, longPress or longPressReleased, as it will re-enter the mutex. Even if the mutex is removed it will deadlock because of the join statement
KeyDelay::~KeyDelay()
{
std::unique_lock<std::mutex> l(_queueMutex);