https://issues.shibboleth.net/jira/browse/CPPXT-70
[shibboleth/cpp-xmltooling.git] / xmltooling / util / Threads.h
index abb8c10..959031d 100644 (file)
@@ -296,6 +296,15 @@ namespace xmltooling
         }
 
         /**
+         * Locks and wraps the designated mutex.
+         *
+         * @param mtx mutex to lock
+         */
+        Lock(Mutex& mtx) : mutex(&mtx) {
+            mtx.lock();
+        }
+
+        /**
          * Unlocks the wrapped mutex.
          */
         ~Lock() {