diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-05-04 15:06:40 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-05-04 15:06:40 -0700 |
commit | f27232bd0aa10be26aeb268b201a6b77bab08a1c (patch) | |
tree | a4e89198a5732111b7d27d499ea2030624ce20c2 /common.h | |
parent | 7e44bcfd8a3b0947bdc7e325671ec5fc4401cb21 (diff) |
Initial work on strategy_named_pipe universal notifier.
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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(); }; |