resource.h
const fiftyoneDegreesResourceManager * manager
Pointer to the manager the handle relates to.
Definition: resource.h:164
const void * resource
Pointer to the resource being managed.
Definition: resource.h:163
void fiftyoneDegreesResourceReplace(fiftyoneDegreesResourceManager *manager, void *newResource, fiftyoneDegreesResourceHandle **newResourceHandle)
Replaces the resource with the new resource.
void fiftyoneDegreesResourceHandleDecUse(fiftyoneDegreesResourceHandle *handle)
Decrements the usage counter.
volatile fiftyoneDegreesInterlockDoubleWidth counter
Counter for this handle.
Definition: resource.h:161
void fiftyoneDegreesResourceManagerFree(fiftyoneDegreesResourceManager *manager)
Frees any data associated with the manager and releases the manager.
Manager structure used to provide access to a shared and changing resource.
Definition: resource.h:173
fiftyoneDegreesResourceHandle * fiftyoneDegreesResourceHandleIncUse(fiftyoneDegreesResourceManager *manager)
Increments the usage counter for the resource and returns a handle that can be used to reference it.
void fiftyoneDegreesResourceManagerInit(fiftyoneDegreesResourceManager *manager, void *resource, fiftyoneDegreesResourceHandle **resourceHandle, void(*freeResource)(void *))
Initialise a preallocated resource manager structure with a resource for it to manage access to.
Double width (64 or 128 depending on the architecture) compare and exchange.
Definition: threading.h:422
volatile fiftyoneDegreesResourceHandle * active
Current handle for resource used by the manager.
Definition: resource.h:175
int32_t fiftyoneDegreesResourceHandleGetUse(fiftyoneDegreesResourceHandle *handle)
Return the current usage counter.