diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-03-20 16:43:22 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-03-20 17:30:03 +0100 |
commit | c8239a1dd46c78f89fa31599036300ecf60108b5 (patch) | |
tree | aab0eb3b038ae1ff938b9b3fbf8cfdcbe61cbe24 /framework/inc | |
parent | 250a4e8875d97a75683349415502a345f03138a0 (diff) |
Remove newly unused framework::LockHelper class
...and make LockHelper::getGlobalLock() FWI_DLLPUBLIC again (so there's a single
such lock, not one per library).
Change-Id: I0aed77333dc93cdf1c7dd7b96620fb7a8eb3dd64
Diffstat (limited to 'framework/inc')
-rw-r--r-- | framework/inc/threadhelp/lockhelper.hxx | 62 |
1 files changed, 7 insertions, 55 deletions
diff --git a/framework/inc/threadhelp/lockhelper.hxx b/framework/inc/threadhelp/lockhelper.hxx index 248fcac94df7..eb2260a6378a 100644 --- a/framework/inc/threadhelp/lockhelper.hxx +++ b/framework/inc/threadhelp/lockhelper.hxx @@ -20,68 +20,20 @@ #ifndef INCLUDED_FRAMEWORK_INC_THREADHELP_LOCKHELPER_HXX #define INCLUDED_FRAMEWORK_INC_THREADHELP_LOCKHELPER_HXX -#include <boost/noncopyable.hpp> -#include <osl/mutex.hxx> -#include <rtl/instance.hxx> +#include <sal/config.h> -#include <comphelper/solarmutex.hxx> #include <fwidllapi.h> -namespace framework{ +namespace osl { class Mutex; } + +namespace framework { namespace LockHelper { //TODO: This presumable should return the SolarMutex, though it actually returns // some independent mutex: -struct GlobalLock: public rtl::Static<osl::Mutex, GlobalLock> {}; - -/*-************************************************************************************************************ - @short helper to set right lock in right situation - @descr This helper support different types of locking: - a) no locks - transparent for user! - This could be useful for simluation or single threaded environments! - b) own mutex - An object use his own osl-mutex to be threadsafe. Useful for easy and exclusiv locking. - c) solar mutex - An object use our solar mutex and will be a part of a greater safed "threadsafe code block". - Could be useful for simulation and testing of higher modules! - d) fair rw-lock - An object use an implementation of a fair rw-lock. This increase granularity of t hreadsafe mechanism - and should be used for high performance threadsafe code! - - @devstatus draft -*//*-*************************************************************************************************************/ -class FWI_DLLPUBLIC LockHelper : private boost::noncopyable -{ - - // public methods - - public: - - - // ctor/dtor - - LockHelper( comphelper::SolarMutex* pSolarMutex = NULL ); - ~LockHelper( ); - - void acquire(); - void release(); - - // something else - - ::osl::Mutex& getShareableOslMutex( ); - - - // private member - // Make some member mutable for using in const functions! - - private: - - mutable comphelper::SolarMutex* m_pSolarMutex ; - mutable ::osl::Mutex* m_pShareableOslMutex ; - mutable sal_Bool m_bDummySolarMutex ; -}; +FWI_DLLPUBLIC osl::Mutex & getGlobalLock(); -} // namespace framework +} } -#endif // INCLUDED_FRAMEWORK_INC_THREADHELP_LOCKHELPER_HXX +#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |