| Overview | Namespace | Class | Index | Help |
::
struct _rtl_ModuleCount
- Base Classes
- None.
- Known Derived Classes
- None.
| virtual | abstract | interface | template |
| NO | NO | NO | NO |
- Description
- Pointers to
rtl_ModuleCountare passed as arguments to the default factory creator functions:createSingleComponentFactory,createSingleFactory,createOneInstanceFactory. The factory implementation is callingrtl_ModuleCount.acquirewhen it is being constructed and it is callingrtl_ModuleCount.release. The implementations ofacquireandreleaseshould influence the return value ofcomponent_canUnloadin a way that it returnssal_Falseafteracquirehas been called. That is the module will not be unloaded once a default factory has been created. A call toreleasemay causecomponent_canUnloadto returnsal_False, but only if there are no object alive which originated from the module. These objects are factory instances and the service instances which have been created by these factories.It is not necessary to synchronize
acquireandreleaseas a whole. Simply sychronize the access to a counter variable, e.g. thertl_moduleCount_releaseimplementation:extern "C" void rtl_moduleCount_acquire(rtl_ModuleCount * that ) { rtl_StandardModuleCount* pMod= (rtl_StandardModuleCount*)that; osl_incrementInterlockedCount( &pMod->counter); }The SAL library offers functions that can be used foracquireandrelease. See struct_rtl_StandardModuleCount.
- File
- unload.h
Top of Page
Copyright 2002 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA.

