diff options
| author | Carl C. Trieloff <cctrieloff@apache.org> | 2007-07-05 16:19:05 +0000 |
|---|---|---|
| committer | Carl C. Trieloff <cctrieloff@apache.org> | 2007-07-05 16:19:05 +0000 |
| commit | a48c9eddce4cbc56521fca7fd64582d9dafe1d40 (patch) | |
| tree | 923b6677edb1754a4a9a89c5ff0b9e2a8cc28439 /cpp/src/qpid/sys/Mutex.h | |
| parent | 18fc5427470dbe4bfd0e9927beb7b0cc5fe01bfc (diff) | |
| download | qpid-python-a48c9eddce4cbc56521fca7fd64582d9dafe1d40.tar.gz | |
- Added RW lock
- Updated all exchanges to us RW lock
- Updated all registries to us RW lock
- Still need to do (client, channel, message and queues)
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@553549 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/Mutex.h')
| -rw-r--r-- | cpp/src/qpid/sys/Mutex.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cpp/src/qpid/sys/Mutex.h b/cpp/src/qpid/sys/Mutex.h index 4eff6078ae..b8545d4449 100644 --- a/cpp/src/qpid/sys/Mutex.h +++ b/cpp/src/qpid/sys/Mutex.h @@ -46,6 +46,26 @@ class ScopedUnlock L& mutex; }; +template <class L> +class ScopedRlock +{ + public: + ScopedRlock(L& l) : mutex(l) { l.rlock(); } + ~ScopedRlock() { mutex.unlock(); } + private: + L& mutex; +}; + +template <class L> +class ScopedWlock +{ + public: + ScopedWlock(L& l) : mutex(l) { l.wlock(); } + ~ScopedWlock() { mutex.unlock(); } + private: + L& mutex; +}; + }} #ifdef USE_APR_PLATFORM |
