Go to the documentation of this file.
35 #ifndef _UCOMMON_ACCESS_H_
36 #define _UCOMMON_ACCESS_H_
38 #ifndef _UCOMMON_CPR_H_
42 #ifndef _UCOMMON_PROTOCOLS_H_
59 virtual void _unlock(
void) = 0;
73 virtual void _lock(
void) = 0;
79 inline void exclusive_lock(
void)
85 inline void release_exclusive(
void)
104 virtual void _share(
void) = 0;
113 virtual void share(
void);
124 inline void shared_lock(
void)
127 inline void release_share(
void)
159 inline bool operator!()
const
160 {
return lock == NULL;};
166 inline operator bool()
const
167 {
return lock != NULL;};
207 inline bool operator!()
const
208 {
return lock == NULL;};
214 inline operator bool()
const
215 {
return lock != NULL;};
240 {
object.exclusive_lock();}
247 {
object.release_exclusive();}
254 {
object.shared_lock();}
261 {
object.release_share();}
268 {
object.exclusive();}
306 #define exclusive_object() exlock_t __autolock__ = this
307 #define protected_object() shlock_t __autolock__ = this
308 #define exclusive_locking(x) exlock_t __autolock__ = &x
309 #define protected_locking(x) shlock_t __autolock__ = &x