|
From: Hans - D. <dul...@eg...> - 2000-08-25 05:42:19
|
I'm implementing EventSemaphore in the following setup: Assuming we have three operations: down(), up(), and zero(). When an EvSem is created, its value is initialized to 1 indicating the expected event has not occured. Any callers who are waiting for the event to occur will do a "lock" by calling zero(). When the event actually takes place, the semaphore will be released via the down() operation. The requirement document (SRS ?) for says that the Many-to-One semaphores will automatically lock upon creation and there is no option to create in unlock. When I look at the code, lock is similar to down() semaphore operation which implies that the creator will be block in the middle of the EventSemaphore ctor. In the context of the above three operations, how can the creator perform a release operation to indicate that the expected event has occured? -- Hans Dulimarta, Ph.D. dul...@co... P: 517-432-7589 http://www.egr.msu.edu/~dulimart F: 760-281-7691 http://corelinux.sourceforge.net Elec. & Comp. Engg., Mich. State Univ., E. Lansing, MI 48824 |