From a48c9eddce4cbc56521fca7fd64582d9dafe1d40 Mon Sep 17 00:00:00 2001 From: "Carl C. Trieloff" Date: Thu, 5 Jul 2007 16:19:05 +0000 Subject: - 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 --- cpp/src/qpid/sys/Mutex.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cpp/src/qpid/sys/Mutex.h') 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 ScopedRlock +{ + public: + ScopedRlock(L& l) : mutex(l) { l.rlock(); } + ~ScopedRlock() { mutex.unlock(); } + private: + L& mutex; +}; + +template +class ScopedWlock +{ + public: + ScopedWlock(L& l) : mutex(l) { l.wlock(); } + ~ScopedWlock() { mutex.unlock(); } + private: + L& mutex; +}; + }} #ifdef USE_APR_PLATFORM -- cgit v1.2.1