git.stg.codes
/
stg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
392a542
)
Allowed to pass mutex by reference into STG_LOCKER.
author
Maxim Mamontov
<faust.madf@gmail.com>
Sat, 12 Sep 2015 11:28:52 +0000
(14:28 +0300)
committer
Maxim Mamontov
<faust.madf@gmail.com>
Sat, 12 Sep 2015 11:28:52 +0000
(14:28 +0300)
include/stg/locker.h
patch
|
blob
|
history
diff --git
a/include/stg/locker.h
b/include/stg/locker.h
index fe1014d779093b94e277f0248f1fa997a12db621..964f17cb44d7ccc0a3b037fe4a940ee9552016c0 100644
(file)
--- 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)
{