FDO API Reference | Feature Data Objects |
#include <Semaphore.h>
Inherits FdoIDisposable.
Inheritance diagram for FdoSemaphore:
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 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 () |
Comments or suggestions? Send us feedback. |