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;
104 virtual void _share(
void) = 0;
113 virtual void share(
void);
124 inline void shared_lock(
void)
127 inline void release_share(
void)
160 {
return lock == NULL;};
166 inline operator bool()
const
167 {
return lock != NULL;};
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
An exclusive locking access interface base.
void exclusive(SharedAccess &object)
Convenience function to exclusive lock shared object through it's protocol.
void release(SharedAccess &object)
Convenience function to unlock shared object through it's protocol.
bool operator!() const
Test if the reference holds an active lock.
An exclusive locking protocol interface base.
void exclusive_lock(void)
Access interface to exclusive lock the object.
void unlock(ExclusiveAccess &object)
Convenience function to unlock an exclusive object through it's protocol.
bool operator!() const
Test if the reference holds an active lock.
Abstract interfaces and support.
A kind of smart pointer object to support shared locking protocol.
void release(void)
Release a held lock programmatically.
shared_access shlock_t
Convenience type to use for object referencing a shared object.
A kind of smart pointer object to support exclusive locking protocol.
void release_exclusive(void)
Access interface to release a lock.
Common unlock protocol for locking protocol interface classes.
void share(SharedAccess &object)
Convenience function to restore shared locking for object through it's protocol.
void modify(accesslock_t &lock)
Convenience function to exclusively schedule conditional access.
exclusive_access exlock_t
Convenience type to use for object referencing an exclusive object.
void access(SharedAccess &object)
Convenience function to access (lock) shared object through it's protocol.
void lock(ExclusiveAccess &object)
Convenience function to exclusively lock an object through it's protocol.
Various miscellaneous platform specific headers and defines.
void release(void)
Release a held lock programmatically.