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

core mutex More...

Go to the source code of this file.

Classes

class  ZFCoreMutexLockerHolder
 see ZFCoreMutexLocker More...
 

Macros

#define ZFCoreMutexLock()
 internal use only
 
#define ZFCoreMutexUnlock()
 see ZFCoreMutexLock
 
#define ZFCoreMutexLocker()
 util method to lock current block
 

Typedefs

typedef void(* ZFCoreMutexImplCallbackLock) (void *token)
 mutex impl
 
typedef void(* ZFCoreMutexImplCallbackUnlock) (void *token)
 mutex impl
 

Functions

void ZFCoreMutexImplSet (void *implObject, ZFCoreMutexImplCallbackLock implLock, ZFCoreMutexImplCallbackUnlock implUnlock)
 ZFCoreMutexLock's implementation, change with caution
 
void * ZFCoreMutexImplGetObject (void)
 see ZFCoreMutexImplSet
 
ZFCoreMutexImplCallbackLock ZFCoreMutexImplGetLock (void)
 see ZFCoreMutexImplSet
 
ZFCoreMutexImplCallbackUnlock ZFCoreMutexImplGetUnlock (void)
 see ZFCoreMutexImplSet
 
zfbool ZFCoreMutexImplAvailable (void)
 see ZFCoreMutexImplSet
 

Detailed Description

core mutex

Macro Definition Documentation

◆ ZFCoreMutexLock

#define ZFCoreMutexLock ( )

internal use only

you may change it at run time by changing ZFCoreMutexImplSet

◆ ZFCoreMutexLocker

#define ZFCoreMutexLocker ( )

util method to lock current block

usage:

{
ZFCoreMutexLocker(); // lock
if(...) return; // safe to return
} // unlock after block
#define ZFCoreMutexLocker()
util method to lock current block
Definition ZFCoreMutex.h:95

you may also use the helper ZFCoreMutexLockerHolder

Type var = (ZFCoreMutexLockerHolder(), yourFuncSynced());
see ZFCoreMutexLocker
Definition ZFCoreMutex.h:68