UCommon
Public Member Functions | Protected Member Functions | Friends
ucommon::SharedObject Class Reference

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

Detailed Description

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.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 1219 of file thread.h.


Member Function Documentation

virtual void ucommon::SharedObject::commit ( SharedPointer pointer) [protected, virtual]

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.

Parameters:
pointerthat now holds the object.

The documentation for this class was generated from the following file: