FDO API Reference | Feature Data Objects |
#include <Semaphore.h>
Inherits FdoIDisposable.
Inheritance diagram for FdoSemaphore:
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 40 of file Semaphore.h.
Static Public Member Functions | |
FdoSemaphore * | Create (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 () |
|
Definition at line 61 of file Semaphore.h. Referenced by Create(). |
|
|
|
|
|
Constructs a new semaphore.
Definition at line 55 of file Semaphore.h. References FdoSemaphore(). |
Here is the call graph for this function:
|
Dispose this object.
Implements FdoIDisposable. Definition at line 65 of file Semaphore.h. |
Comments or suggestions? Send us feedback. |