5-10 SOMobjects Base Toolkit Programmer’s Reference
Manual
someGetEManSem Method
Purpose
Acquires EMan semaphores to achieve mutual exclusion with EMan’s activity.
IDL Syntax
void someGetEManSem ( );
Description
When EMan is used on OS/2, multiple threads can invoke methods on EMan concurrently.
EMan protects its internal data by acquiring SOM toolkit semaphores. The same
semaphores are made available to users of EMan through the methods
someGetEManSem and someReleaseEManSem. If an application desires to prevent
EMan event processing from interfering with its own activity (in another thread, of course),
then it can call the someGetEManSem method and acquire EMan semaphores. EMan
activity will resume when the application thread releases the same semaphores by calling
someReleaseEManSem.
Callers should not hold this semaphore for too long, since it essentially stops EMan activity
for that duration and may cause EMan to miss some important event processing. The
maximum duration for which one can hold this semaphore depends on how frequently
EMan must process events.
On AIX or Windows, calling this method has no effect.
Parameters
receiver A pointer to an object of class SOMEEMan.
ev A pointer to the Environment structure for the calling method.
Example
#include <eman.h>
SOMEEMan *EManPtr;
Environment *Ev;
...
_someGetEManSem(EManPtr, Ev);
/* Do the work that needs mutual exclusion with EMan */
_someReleaseEManSem(EManPtr, Ev);
Original Class
SOMEEMan
Related Information
Methods: someReleaseEManSem
Komentarze do niniejszej Instrukcji