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
void share(SharedAccess &object)
Convenience function to restore shared locking for object through it's protocol.
Abstract interfaces and support.
void modify(accesslock_t &lock)
Convenience function to exclusively schedule conditional access.
void release(void)
Release a held lock programmatically.
A kind of smart pointer object to support shared locking protocol.
void access(SharedAccess &object)
Convenience function to access (lock) shared object through it's protocol.
An exclusive locking protocol interface base.
Common namespace for all ucommon objects.
void exclusive(SharedAccess &object)
Convenience function to exclusive lock shared object through it's protocol.
void unlock(ExclusiveAccess &object)
Convenience function to unlock an exclusive object through it's protocol.
void exclusive_lock(void)
Access interface to exclusive lock the object.
void release(SharedAccess &object)
Convenience function to unlock shared object through it's protocol.
A kind of smart pointer object to support exclusive locking protocol.
Various miscellaneous platform specific headers and defines.
bool operator!() const
Test if the reference holds an active lock.
Common unlock protocol for locking protocol interface classes.
void release_exclusive(void)
Access interface to release a lock.
exclusive_access exlock_t
Convenience type to use for object referencing an exclusive object.
void lock(ExclusiveAccess &object)
Convenience function to exclusively lock an object through it's protocol.
void release(void)
Release a held lock programmatically.
shared_access shlock_t
Convenience type to use for object referencing a shared object.
An exclusive locking access interface base.
bool operator!() const
Test if the reference holds an active lock.