diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-04-16 15:34:41 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-04-16 17:52:37 +0200 |
commit | 1268326e814837e111eaf320f72661f288393839 (patch) | |
tree | 5518044c0fc0c952ae365560c287e7b3d5162929 /sal/rtl/unload.cxx | |
parent | b98617b3c86863fe5b4e3d9a96519707ae8cf58c (diff) |
Further clean-up related to removed library unloading feature
Change-Id: I1ec2aa4d0ed0940e7c0a26a18c78f2df4693d278
Diffstat (limited to 'sal/rtl/unload.cxx')
-rw-r--r-- | sal/rtl/unload.cxx | 76 |
1 files changed, 8 insertions, 68 deletions
diff --git a/sal/rtl/unload.cxx b/sal/rtl/unload.cxx index dd8ee23b49bc..0b5bc2e79d27 100644 --- a/sal/rtl/unload.cxx +++ b/sal/rtl/unload.cxx @@ -17,79 +17,19 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <rtl/unload.h> +#include "sal/config.h" -#include <rtl/ustring.hxx> -#include <rtl/instance.hxx> -#include <osl/mutex.hxx> +#include "osl/time.h" +#include "rtl/unload.h" -using osl::MutexGuard; +extern "C" void rtl_moduleCount_acquire(rtl_ModuleCount *) {} -//---------------------------------------------------------------------------- +extern "C" void rtl_moduleCount_release(rtl_ModuleCount *) {} -#ifndef DISABLE_DYNLOADING - -namespace -{ - class theUnloadingMutex : public rtl::Static<osl::Mutex, theUnloadingMutex>{}; -} - -static osl::Mutex& getUnloadingMutex() -{ - return theUnloadingMutex::get(); -} - -#endif - -extern "C" void rtl_moduleCount_acquire(rtl_ModuleCount * that ) -{ -#ifdef DISABLE_DYNLOADING - (void) that; -#else - rtl_StandardModuleCount* pMod= (rtl_StandardModuleCount*)that; - osl_atomic_increment( &pMod->counter); -#endif -} - -extern "C" void rtl_moduleCount_release( rtl_ModuleCount * that ) -{ -#ifdef DISABLE_DYNLOADING - (void) that; -#else - rtl_StandardModuleCount* pMod= (rtl_StandardModuleCount*)that; - OSL_ENSURE( pMod->counter >0 , "library counter incorrect" ); - osl_atomic_decrement( &pMod->counter); - if( pMod->counter == 0) - { - MutexGuard guard( getUnloadingMutex()); - - if( sal_False == osl_getSystemTime( &pMod->unusedSince) ) - { - // set the time to 0 if we could not get the time - pMod->unusedSince.Seconds= 0; - pMod->unusedSince.Nanosec= 0; - } - } -#endif -} - -extern "C" sal_Bool rtl_moduleCount_canUnload( rtl_StandardModuleCount * that, TimeValue * libUnused) +extern "C" sal_Bool rtl_moduleCount_canUnload( + rtl_StandardModuleCount *, TimeValue *) { -#ifdef DISABLE_DYNLOADING - (void) that; - (void) libUnused; - return sal_False; -#else - if (that->counter == 0) - { - MutexGuard guard( getUnloadingMutex()); - if (libUnused && (that->counter == 0)) - { - memcpy(libUnused, &that->unusedSince, sizeof(TimeValue)); - } - } - return (that->counter == 0); -#endif + return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |