Skip to content

Commit

Permalink
Make YubiKey::s_interfaceMutex non-recursive
Browse files Browse the repository at this point in the history
It does not need to be a recursive mutex, as per
#7783 (comment).
  • Loading branch information
c4rlo authored and droidmonkey committed Jun 22, 2024
1 parent 80b483e commit 0115713
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
6 changes: 1 addition & 5 deletions src/keys/drivers/YubiKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
#include <QSet>
#include <QtConcurrent>

#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QRecursiveMutex YubiKey::s_interfaceMutex;
#else
QMutex YubiKey::s_interfaceMutex(QMutex::Recursive);
#endif
QMutex YubiKey::s_interfaceMutex;

YubiKey::YubiKey()
{
Expand Down
12 changes: 1 addition & 11 deletions src/keys/drivers/YubiKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,9 @@

#include <QHash>
#include <QMultiMap>
#include <QMutex>
#include <QObject>
#include <QTimer>
#include <qmutex.h>

#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
#include <QRecursiveMutex>
#else
#include <QMutex>
#endif

#include <botan/secmem.h>

Expand Down Expand Up @@ -94,11 +88,7 @@ class YubiKey : public QObject
bool m_initialized = false;
QString m_error;

#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
static QRecursiveMutex s_interfaceMutex;
#else
static QMutex s_interfaceMutex;
#endif

KeyMap m_usbKeys;
KeyMap m_pcscKeys;
Expand Down

0 comments on commit 0115713

Please sign in to comment.