ZFFramework
 
Loading...
Searching...
No Matches
ZFObjectMutex.h File Reference

mutex impl for ZFObject More...

Go to the source code of this file.

Typedefs

typedef void *(* ZFObjectMutexImplCallbackInit) (void)
 see ZFObjectMutexImplSet
 
typedef void(* ZFObjectMutexImplCallbackDealloc) (void *implObject)
 see ZFObjectMutexImplSet
 
typedef ZFCoreMutexImplCallbackLock ZFObjectMutexImplCallbackLock
 see ZFObjectMutexImplSet
 
typedef ZFCoreMutexImplCallbackUnlock ZFObjectMutexImplCallbackUnlock
 see ZFObjectMutexImplSet
 
typedef zfbool(* ZFObjectMutexImplCallbackTryLock) (void *implObject)
 see ZFObjectMutexImplSet
 

Functions

void ZFObjectMutexImplSet (ZFObjectMutexImplCallbackInit implInit=zft_zfnull, ZFObjectMutexImplCallbackDealloc implDealloc=zft_zfnull, ZFObjectMutexImplCallbackLock implLock=zft_zfnull, ZFObjectMutexImplCallbackUnlock implUnlock=zft_zfnull, ZFObjectMutexImplCallbackTryLock implTryLock=zft_zfnull)
 change the implementation for mutex
 
ZFObjectMutexImplCallbackInit ZFObjectMutexImplGetInit (void)
 see ZFObjectMutexImplSet
 
ZFObjectMutexImplCallbackDealloc ZFObjectMutexImplGetDealloc (void)
 see ZFObjectMutexImplSet
 
ZFObjectMutexImplCallbackLock ZFObjectMutexImplGetLock (void)
 see ZFObjectMutexImplSet
 
ZFObjectMutexImplCallbackUnlock ZFObjectMutexImplGetUnlock (void)
 see ZFObjectMutexImplSet
 
ZFObjectMutexImplCallbackTryLock ZFObjectMutexImplGetTryLock (void)
 see ZFObjectMutexImplSet
 
zfbool ZFObjectMutexImplAvailable (void)
 see ZFObjectMutexImplSet
 

Detailed Description

mutex impl for ZFObject

Function Documentation

◆ ZFObjectMutexImplSet()

void ZFObjectMutexImplSet ( ZFObjectMutexImplCallbackInit implInit = zft_zfnull,
ZFObjectMutexImplCallbackDealloc implDealloc = zft_zfnull,
ZFObjectMutexImplCallbackLock implLock = zft_zfnull,
ZFObjectMutexImplCallbackUnlock implUnlock = zft_zfnull,
ZFObjectMutexImplCallbackTryLock implTryLock = zft_zfnull )
extern

change the implementation for mutex

mutex is an optional module for ZFFramework, however you should only setup the impl once during init setup, and should not change it anymore (it's safe to change impl during runtime if no object holds mutex, but that's fairly impossible for most case)
the impl can be attached at any time, but must not be detached until all mutex has been unlocked, typically you should register by ZFOBJECT_MUTEX_IMPL_DEFINE

note, changing this impl would also change ZFCoreMutexImplSet