summaryrefslogtreecommitdiffhomepage
path: root/opentrack/win32-joystick.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-29 11:58:20 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-29 11:58:48 +0100
commitedb0e01947f67142c00c3f75a62df7af708cdf11 (patch)
tree5ac50202796be1964662a278186b92992868c06a /opentrack/win32-joystick.hpp
parent044b799a15ec8b47094d6086b13ec77f991b6054 (diff)
api/joystick: reduce mutex contention
Don't look for changes in hotplug joysticks by freezing up polling for joysticks' axis and button. Issue: #267
Diffstat (limited to 'opentrack/win32-joystick.hpp')
-rw-r--r--opentrack/win32-joystick.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/opentrack/win32-joystick.hpp b/opentrack/win32-joystick.hpp
index 334b617a..3f47d170 100644
--- a/opentrack/win32-joystick.hpp
+++ b/opentrack/win32-joystick.hpp
@@ -100,14 +100,14 @@ private:
class enum_state
{
- std::unordered_map<QString, std::shared_ptr<joy>>& joys;
+ std::unordered_map<QString, std::shared_ptr<joy>> joys;
bool first;
std::vector<QString> all;
static BOOL CALLBACK EnumJoysticksCallback(const DIDEVICEINSTANCE* pdidInstance, VOID* pContext);
static BOOL CALLBACK EnumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* ctx);
public:
- enum_state(std::unordered_map<QString, std::shared_ptr<joy>>& joys, bool first);
+ enum_state(std::unordered_map<QString, std::shared_ptr<joy>>& joys, bool first, QMutex &mtx);
};
};