My Project
UDK 3.2.7 C/C++ API Reference
|
Pointers to rtl_ModuleCount
are passed as arguments to the default factory creator functions: createSingleComponentFactory
, createSingleFactory
, createOneInstanceFactory
.
More...
#include <unload.h>
Public Attributes | |
void(* | acquire )(struct _rtl_ModuleCount *that) |
void(* | release )(struct _rtl_ModuleCount *that) |
Pointers to rtl_ModuleCount
are passed as arguments to the default factory creator functions: createSingleComponentFactory
, createSingleFactory
, createOneInstanceFactory
.
The factory implementation is calling rtl_ModuleCount.acquire
when it is being constructed and it is calling rtl_ModuleCount.release
. The implementations of acquire
and release
should influence the return value of component_canUnload
in a way that it returns sal_False
after acquire
has been called. That is the module will not be unloaded once a default factory has been created. A call to release
may cause component_canUnload
to return sal_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 acquire
and release
as a whole. Simply sychronize the access to a counter variable, e.g. the rtl_moduleCount_release
implementation:
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 for acquire
and release
. See struct _rtl_StandardModuleCount
.
void( * _rtl_ModuleCount::acquire)(struct _rtl_ModuleCount *that) |
void( * _rtl_ModuleCount::release)(struct _rtl_ModuleCount *that) |