|
UCommon
|
The shared pointer is used to manage a singleton instance of shared object. More...
#include <thread.h>


Protected Member Functions | |
| void | replace (SharedObject *object) |
| Replace existing singleton instance with new one. More... | |
| SharedObject * | share (void) |
| Acquire a shared reference to the singleton object. More... | |
| SharedPointer () | |
| Created shared locking for pointer. More... | |
| ~SharedPointer () | |
| Destroy lock and release any blocked threads. | |
Protected Member Functions inherited from ucommon::ConditionalAccess | |
| void | broadcast (void) |
| Signal the conditional to release all broadcast threads. | |
| void | lock (void) |
| Lock the conditional's supporting mutex. | |
| void | signal (void) |
| Signal the conditional to release one signalled thread. | |
| void | unlock (void) |
| Unlock the conditional's supporting mutex. | |
| bool | waitBroadcast (timeout_t timeout) |
| Conditional wait for broadcast on millisecond timeout. More... | |
| bool | waitBroadcast (struct timespec *timeout) |
| Conditional wait for broadcast on timespec timeout. More... | |
| void | waitBroadcast (void) |
| Wait (block) until broadcast. | |
| bool | waitSignal (timeout_t timeout) |
| Conditional wait for signal on millisecond timeout. More... | |
| bool | waitSignal (struct timespec *timeout) |
| Conditional wait for signal on timespec timeout. More... | |
| void | waitSignal (void) |
| Wait (block) until signalled. | |
| void | access (void) |
| Access mode shared thread scheduling. | |
| void | commit (void) |
| Complete exclusive mode write scheduling. | |
| ConditionalAccess () | |
| Initialize and construct conditional. | |
| void | limit_sharing (unsigned max) |
| Specify a maximum sharing (access) limit. More... | |
| void | modify (void) |
| Exclusive mode write thread scheduling. | |
| void | release (void) |
| Release access mode read scheduling. | |
| ~ConditionalAccess () | |
| Destroy conditional, release any blocked threads. | |
Friends | |
| class | shared_release |
Additional Inherited Members | |
Static Protected Member Functions inherited from ucommon::ConditionalAccess | |
| static void | set (struct timespec *hires, timeout_t timeout) |
| Convert a millisecond timeout into use for high resolution conditional timers. More... | |
Protected Attributes inherited from ucommon::ConditionalAccess | |
| pthread_cond_t | bcast |
| unsigned | pending |
| unsigned | sharing |
| unsigned | waiting |
The shared pointer is used to manage a singleton instance of shared object.
This class is used to support the templated shared_pointer class and the shared_release class, and is not meant to be used directly or as a base for anything else. One or more threads may aquire a shared lock to the singleton object through this pointer, and it can only be replaced with a new singleton instance when no threads reference it. The conditional lock is used to manage shared access for use and exclusive access when modified.
|
protected |
Created shared locking for pointer.
Must be assigned by replace.
|
protected |
Replace existing singleton instance with new one.
This happens during exclusive locking, and the commit method of the object will be called.
| object | being set. |
|
protected |
Acquire a shared reference to the singleton object.
This is a form of shared access lock. Derived classes and templates access "release" when the shared pointer is no longer needed.
1.8.6