DIRECTORY Xl, Process; XlTQPrivate: CEDAR DEFINITIONS ~ BEGIN TQRec: TYPE = MONITORED RECORD [ selfProcess: PROCESS, -- process executing queued events selfRunning: BOOL ¬ FALSE, -- process (selfProcess) exists or will come into existence soon selfRunning2: BOOL ¬ FALSE, -- lockProcess: PROCESS, -- process holding lock [defined if lockCount>0 and ~selfProcess] lockCount: CARD ¬ 0, -- number of locks of processes [defined if ~selfProcess]; eventCount: CARD ¬ 0, -- number of queued but not yet handled events next: Job ¬ NIL, -- the next event to be handled tail: Job ¬ NIL, -- for fast inclusion at end of tail newEvent: CONDITION, -- running process sleeps before disappearing lockWaiterCond: CONDITION, -- waiting for change in lock state lockWaiterCount: INT ¬ 0, -- number of processes waiting on lockWaiterCond upperLimit: CARD ¬2000, -- if there are more events we start throwing some away this: Job ¬ NIL, -- Job in execution right now free: Job ¬ NIL, -- list of free entries freeCnt: CARD ¬ 0, -- number of entries on free list order: INT ¬ 0, -- lock order seq1, seq2: INT ¬ 0, -- lock order dead: BOOL ¬ FALSE, -- set using debugger; useful to reduce number of hanging resources props: <> REF ¬ NIL, --reserved for property list priority: Process.Priority ¬ Process.priorityForeground, --used after fork only createData: REF ¬ NIL -- useful for debugging ]; Job: TYPE = REF JobRec; JobRec: TYPE = RECORD [event: Xl.Event, proc: Xl.EventProcType, data: REF, next: Job ¬ NIL]; DirtyPeekNextIsMouseEvent: PROC [tq: Xl.TQ] RETURNS [BOOL] = TRUSTED INLINE { next: Job ¬ LOOPHOLE[tq, REF TQRec].next; RETURN [next#NIL AND next.event#NIL AND next.event.type=motionNotify] }; SetTQReadiness: PROC [tq: Xl.TQ, ms: INT]; SetTQPriority: PROC [tq: Xl.TQ, priority: Process.Priority]; RemoveErrorEvents: PROC [tq: Xl.TQ] END. lXlTQPrivate.mesa Copyright Σ 1990, 1991, 1992 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, March 28, 1990 Christian Jacobi, June 15, 1992 5:16 pm PDT PRIVATE to XlImplTQ; recompiled outside of "release" --type which implements Xl.TQRep -- lock is free if lockCount=0 AND ~this=NIL Regular usage: to record queued entries --To work without lock, this must be called running on tq --TQ stays ready to start up fast for ms milliseconds after last job --New priority is set only when freshly forked --Removes all leading error events --Use when interactively required while debugging Κρ•NewlineDelimiter –(cedarcode) style˜codešœ™Kšœ Οeœ=™HKšœ+™+K™,K™—šΟk œ ˜K˜—KšΟn œžœž ˜Kšœžœ˜K™Kšœ4™4K˜šœžœž œžœ˜ Kšœ ™ Kšœ žœΟc"˜8Kšœ žœžœ A˜\Kšœžœžœ ˜ Kšœ žœ 0Πci ˜WKšœ žœ ;˜PK™.Kšœ žœ .˜DKšœ žœ ˜5Kšœ žœ $˜5Kšœ ž œ -˜BKšœž œ $˜?Kšœžœ 0˜JKšœ žœ 7˜OKš œ žœ      ˜.Kšœ žœ ˜(Kšœ žœ !˜4Kšœžœ  ˜Kšœ žœ  ˜#Kšœžœžœ C˜XKšœžœžœ ˜;Kšœ9 ˜OKšœ žœžœ ˜-Kšœ˜K˜—Kšœžœžœ˜š œžœžœ1žœžœ˜\K™'—K˜šŸœžœ žœžœžœžœžœ˜MKš 9™9Kšœ žœžœ ˜)Kš žœžœžœ žœžœ˜FK˜K˜—šŸœžœ žœžœ˜*Kš œB™D—K˜šŸ œžœ žœ˜