summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-09-15 16:34:11 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-09-20 12:47:46 +0200
commitff1f2248b830ad78833e347be8d8c8dc9cb03c85 (patch)
tree8d22aa095ffdca75ca9fb4048ed61433370ccaa3 /include
parent2e446c208e3522ff3b7a38eec40368fe15528a80 (diff)
downloadlibnitrokey-ff1f2248b830ad78833e347be8d8c8dc9cb03c85.tar.gz
libnitrokey-ff1f2248b830ad78833e347be8d8c8dc9cb03c85.tar.bz2
Correct mutex placement
Move mutex from template instantation to single compilation unit to make it work as desired Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include')
-rw-r--r--include/device_proto.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/device_proto.h b/include/device_proto.h
index 691c17b..4a548a0 100644
--- a/include/device_proto.h
+++ b/include/device_proto.h
@@ -37,6 +37,9 @@
namespace nitrokey {
namespace proto {
+ extern std::mutex send_receive_mtx;
+
+
/*
* POD types for HID proto commands
* Instances are meant to be __packed.
@@ -215,7 +218,6 @@ namespace nitrokey {
using namespace ::nitrokey::log;
using namespace std::chrono_literals;
- static std::mutex send_receive_mtx;
std::lock_guard<std::mutex> guard(send_receive_mtx);
LOG(__FUNCTION__, Loglevel::DEBUG_L2);