ucommon
|
Shared singleton object. More...
#include <thread.h>
Public Member Functions | |
virtual | ~SharedObject () |
Allows inherited virtual. |
Protected Member Functions | |
virtual void | commit (SharedPointer *pointer) |
Commit is called when a shared singleton is accepted and replaces a prior instance managed by a shared pointer. |
Friends | |
class | SharedPointer |
Shared singleton object.
A shared singleton object is a special kind of object that may be shared by multiple threads but which only one active instance is allowed to exist. The shared object is managed by the templated shared pointer class, and is meant to be inherited as a base class for the derived shared singleton type.
|
protectedvirtual |
Commit is called when a shared singleton is accepted and replaces a prior instance managed by a shared pointer.
Commit occurs when replace is called on the shared pointer, and is assured to happen only when no threads are accessing either the current or the prior instance that was previously protected by the pointer.
pointer | that now holds the object. |