X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/c3d4d096451b5c683492e81574b302e5486950e1..1e8eb98d30459399902534082c88b94bb26bb2e3:/include/stg/locker.h?ds=sidebyside

diff --git a/include/stg/locker.h b/include/stg/locker.h
index fe1014d7..16b0323f 100644
--- a/include/stg/locker.h
+++ b/include/stg/locker.h
@@ -34,7 +34,12 @@
 class STG_LOCKER
 {
 public:
-    STG_LOCKER(pthread_mutex_t * m)
+    explicit STG_LOCKER(pthread_mutex_t& m)
+        : mutex(&m)
+        {
+        pthread_mutex_lock(mutex);
+        }
+    explicit STG_LOCKER(pthread_mutex_t * m)
         : mutex(m)
         {
         pthread_mutex_lock(mutex);