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

type define for synchronize logic in ZFFramework More...

#include "ZFObjectCore.h"
#include "zfany.h"

Go to the source code of this file.

Macros

#define zfsynchronize(obj)
 similar to synchronized in Java
 
#define zfsynchronizeLock(obj)
 similar to zfsynchronize, while you take the responsibility to close it by zfsynchronizeUnlock
 
#define zfsynchronizeUnlock(obj)
 see zfsynchronizeLock
 

Detailed Description

type define for synchronize logic in ZFFramework

Macro Definition Documentation

◆ zfsynchronize

#define zfsynchronize ( obj)

similar to synchronized in Java

usage:

ZFObject *obj = ...;
...
// not mutable
{
// mutable
}
// not mutable
base class of all objects
Definition ZFObjectCore.h:209
#define zfsynchronize(obj)
similar to synchronized in Java
Definition zfsynchronize.h:37

◆ zfsynchronizeLock

#define zfsynchronizeLock ( obj)

similar to zfsynchronize, while you take the responsibility to close it by zfsynchronizeUnlock

usage:

// mutable operation
#define zfsynchronizeUnlock(obj)
see zfsynchronizeLock
Definition zfsynchronize.h:68
#define zfsynchronizeLock(obj)
similar to zfsynchronize, while you take the responsibility to close it by zfsynchronizeUnlock
Definition zfsynchronize.h:58

it's not necessary to put them in the same code block, but you must ensure the lock and unlock are paired

See also
zfsynchronize