From: Maxim Mamontov Date: Sat, 12 Sep 2015 11:28:52 +0000 (+0300) Subject: Allowed to pass mutex by reference into STG_LOCKER. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/b1fdd325ac311f299eedcd6725a56cc1e8d311a8?hp=392a542a849ec49772db0eb237bb064c4f09008d Allowed to pass mutex by reference into STG_LOCKER. --- diff --git a/include/stg/locker.h b/include/stg/locker.h index fe1014d7..964f17cb 100644 --- a/include/stg/locker.h +++ b/include/stg/locker.h @@ -34,6 +34,11 @@ class STG_LOCKER { public: + STG_LOCKER(pthread_mutex_t& m) + : mutex(&m) + { + pthread_mutex_lock(mutex); + } STG_LOCKER(pthread_mutex_t * m) : mutex(m) {