unload.cxx (86e1cf34) | unload.cxx (22076bf1) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 14 unchanged lines hidden (view full) --- 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_sal.hxx" 26#include <rtl/unload.h> 27#include <rtl/alloc.h> 28#include <rtl/ustring.hxx> 29#include <osl/mutex.hxx> 30#include <hash_map> | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 14 unchanged lines hidden (view full) --- 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_sal.hxx" 26#include <rtl/unload.h> 27#include <rtl/alloc.h> 28#include <rtl/ustring.hxx> 29#include <osl/mutex.hxx> 30#include <hash_map> |
31#include "rtl/allocator.hxx" | |
32 33#include <functional> 34#include <list> 35#include <deque> 36 37using osl::MutexGuard; 38 39//---------------------------------------------------------------------------- --- 108 unchanged lines hidden (view full) --- 148{ 149 size_t operator()( const oslModule& rkey) const 150 { 151 return (size_t)rkey; 152 } 153}; 154 155typedef std::hash_map< | 31 32#include <functional> 33#include <list> 34#include <deque> 35 36using osl::MutexGuard; 37 38//---------------------------------------------------------------------------- --- 108 unchanged lines hidden (view full) --- 147{ 148 size_t operator()( const oslModule& rkey) const 149 { 150 return (size_t)rkey; 151 } 152}; 153 154typedef std::hash_map< |
156 oslModule, | 155 const oslModule, |
157 std::pair<sal_uInt32, component_canUnloadFunc>, 158 hashModule, | 156 std::pair<sal_uInt32, component_canUnloadFunc>, 157 hashModule, |
159 std::equal_to<oslModule>, 160 rtl::Allocator<oslModule> | 158 std::equal_to<oslModule> |
161> ModuleMap; 162 163typedef ModuleMap::iterator Mod_IT; 164 165static ModuleMap& getModuleMap() 166{ 167 static ModuleMap * g_pMap= NULL; 168 if (!g_pMap) --- 69 unchanged lines hidden (view full) --- 238 moduleMap.erase( it); 239 } 240} 241 242extern "C" void SAL_CALL rtl_unloadUnusedModules( TimeValue* libUnused) 243{ 244 MutexGuard guard( getUnloadingMutex()); 245 | 159> ModuleMap; 160 161typedef ModuleMap::iterator Mod_IT; 162 163static ModuleMap& getModuleMap() 164{ 165 static ModuleMap * g_pMap= NULL; 166 if (!g_pMap) --- 69 unchanged lines hidden (view full) --- 236 moduleMap.erase( it); 237 } 238} 239 240extern "C" void SAL_CALL rtl_unloadUnusedModules( TimeValue* libUnused) 241{ 242 MutexGuard guard( getUnloadingMutex()); 243 |
246 typedef std::list< oslModule, rtl::Allocator<oslModule> > list_type; | 244 typedef std::list< oslModule > list_type; |
247 list_type unloadedModulesList; 248 249 ModuleMap& moduleMap= getModuleMap(); 250 Mod_IT it_e= moduleMap.end(); 251 252 // notify all listeners 253 rtl_notifyUnloadingListeners(); 254 --- 42 unchanged lines hidden (view full) --- 297{ 298 size_t operator()( const sal_Int32& rkey) const 299 { 300 return (size_t)rkey; 301 } 302}; 303 304typedef std::hash_map< | 245 list_type unloadedModulesList; 246 247 ModuleMap& moduleMap= getModuleMap(); 248 Mod_IT it_e= moduleMap.end(); 249 250 // notify all listeners 251 rtl_notifyUnloadingListeners(); 252 --- 42 unchanged lines hidden (view full) --- 295{ 296 size_t operator()( const sal_Int32& rkey) const 297 { 298 return (size_t)rkey; 299 } 300}; 301 302typedef std::hash_map< |
305 sal_Int32, | 303 const sal_Int32, |
306 std::pair<rtl_unloadingListenerFunc, void*>, 307 hashListener, | 304 std::pair<rtl_unloadingListenerFunc, void*>, 305 hashListener, |
308 std::equal_to<sal_Int32>, 309 rtl::Allocator<sal_Int32> | 306 std::equal_to<sal_Int32> |
310> ListenerMap; 311 312typedef ListenerMap::iterator Lis_IT; 313 314static ListenerMap& getListenerMap() 315{ 316 static ListenerMap * g_pListeners= NULL; 317 if (!g_pListeners) --- 10 unchanged lines hidden (view full) --- 328 329 330// This queue contains cookies which have been passed out by rtl_addUnloadingListener and 331// which have been regainded by rtl_removeUnloadingListener. When rtl_addUnloadingListener 332// is called then a cookie has to be returned. First we look into the set if there is one 333// available. Otherwise a new cookie will be provided. 334// not a new value is returned. 335 | 307> ListenerMap; 308 309typedef ListenerMap::iterator Lis_IT; 310 311static ListenerMap& getListenerMap() 312{ 313 static ListenerMap * g_pListeners= NULL; 314 if (!g_pListeners) --- 10 unchanged lines hidden (view full) --- 325 326 327// This queue contains cookies which have been passed out by rtl_addUnloadingListener and 328// which have been regainded by rtl_removeUnloadingListener. When rtl_addUnloadingListener 329// is called then a cookie has to be returned. First we look into the set if there is one 330// available. Otherwise a new cookie will be provided. 331// not a new value is returned. 332 |
336typedef std::deque< 337 sal_Int32, 338 rtl::Allocator<sal_Int32> 339> queue_type; | 333typedef std::deque< sal_Int32 > queue_type; |
340 341static queue_type& getCookieQueue() 342{ 343 static queue_type * g_pCookies= NULL; 344 if (!g_pCookies) 345 { 346 MutexGuard guard( getUnloadingMutex() ); 347 if (!g_pCookies) --- 66 unchanged lines hidden --- | 334 335static queue_type& getCookieQueue() 336{ 337 static queue_type * g_pCookies= NULL; 338 if (!g_pCookies) 339 { 340 MutexGuard guard( getUnloadingMutex() ); 341 if (!g_pCookies) --- 66 unchanged lines hidden --- |