aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-05-04 15:06:40 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-05-04 15:06:40 -0700
commitf27232bd0aa10be26aeb268b201a6b77bab08a1c (patch)
treea4e89198a5732111b7d27d499ea2030624ce20c2 /common.h
parent7e44bcfd8a3b0947bdc7e325671ec5fc4401cb21 (diff)
Initial work on strategy_named_pipe universal notifier.
Diffstat (limited to 'common.h')
-rw-r--r--common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/common.h b/common.h
index 8e794acb..18821509 100644
--- a/common.h
+++ b/common.h
@@ -537,6 +537,22 @@ public:
bool is_forked_child();
+
+class lock_t
+{
+ public:
+ pthread_mutex_t mutex;
+ lock_t()
+ {
+ pthread_mutex_init(&mutex, NULL);
+ }
+
+ ~lock_t()
+ {
+ pthread_mutex_destroy(&mutex);
+ }
+};
+
/* Basic scoped lock class */
class scoped_lock
{
@@ -551,6 +567,7 @@ public:
void lock(void);
void unlock(void);
scoped_lock(pthread_mutex_t &mutex);
+ scoped_lock(lock_t &lock);
~scoped_lock();
};