[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: window-null-event-handler semiphore
- To: paul_hasse@NSDGATE3.nsd.fmc.com (paul hasse), info-mcl@digitool.com
- Subject: Re: window-null-event-handler semiphore
- From: e@flavors.com (Doug Currie, Flavors Technology, Inc.)
- Date: Tue, 21 Mar 1995 11:59:31 -0500
- Sender: owner-info-mcl@digitool.com
At 9:36 AM 95.03.21, paul hasse wrote:
>I have installed an :after method on the window-null-event-handler. I have
>noticed that this handler seems to be called at virtually any time. Is this
>true? What I need to be able to do is lock out this event handler while I do
>some processing, do the processing and then restart the event handler. What I
>really need is a semiphore. Any suggestions?
There are at least three options:
1) Use without-interrupts around your processing; it locks out all events
2) modify your window-null-event-handler to check a *wneh-lock* special
variable; when the variable is non-zero the method should just return.
*wneh-lock* needn't be a semaphore since it's only written by one process?
(Yes? If not, make it an up/down counter and incf/decf it inside a
without-interrupts.) Your processing should set (incf) the *wneh-lock* when
it begins, and clear (decf) the *wneh-lock* when it finishes. Use
unwind-protect.
3) during your processing, install a custom event handler that punts
null-events; again, use a let-binding to capure (possible nested) previous
handlers.
(let ((*eventhook*
#'(lambda () (= #$nullevent (rref *current-event* :eventrecord.what)))))
; your processing
)
e