FDO API Reference Feature Data Objects

FdoSemaphore Class Reference

#include <Semaphore.h>

Inherits FdoIDisposable.

Inheritance diagram for FdoSemaphore:

Inheritance graph
[legend]
List of all members.

Detailed Description

FdoSemaphore is a semaphore class. It is used to prevent operations from happening concurrently or re-entrantly. FdoSemaphore is not currently part of the FDO API but can be added if there is a demand. It is a wrapper class around a boolean semaphore.

DOXYGEN-IGNORE

FdoSemaphore can be used to prevent a member function on another class from being called re-entrantly for the same object (see FdoXmlReaderXrcs::Parse()) for an example. This can be done by declaring a FdoSemaphoreP, at the start of the function, that takes a boolean member and an exception. The boolean member must initially be false. When the FdoSemaphoreP is created, the boolean member is set to true. When the function exits, FdoSemaphoreP goes out of scope and sets the boolean member back to false. However, if the function is called a second time before the first invokation finishes, the second FdoSemaphoreP created will detect that the boolean member is true, and it will throw the given exception, thus rejecting the re-entrant function call.

Definition at line 39 of file Semaphore.h.


Static Public Member Functions

static FdoSemaphoreCreate (FdoBoolean &semaphore, FdoException *ex)
 Constructs a new semaphore.

Protected Member Functions

virtual void Dispose ()
 Dispose this object.
 FdoSemaphore (bool &semaphore, FdoException *ex)
 FdoSemaphore ()
virtual ~FdoSemaphore ()

The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.