summaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index dc58e4d..ee7ca92 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -88,7 +88,8 @@ namespace nitrokey{
}
shared_ptr<NitrokeyManager> NitrokeyManager::instance() {
- //FIXME check thread safety - add atomic for instance, add lock guard
+ static std::mutex mutex;
+ std::lock_guard<std::mutex> lock(mutex);
if (_instance == nullptr){
_instance = make_shared<NitrokeyManager>();
}