[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Release/reacquire in T3
I've been writing some graphics stuff for the Apollos in T3 and was forced
to write the function supplied below to do the right thing when (error ...)
is called. I haven't thought about what to do about GC yet. Let me know
when you find out how *pre-gc-agenda* works.
The release/reacquire in the error function works just fine unless the process
is waiting on event input. If something happens then (I'm guessing a GC
can't) one seems to be out of luck. Also, the error function itself should
be extended a little deeper (or augmented with another) to handle T VM faults.
It doesn't do the right thing when one occurs.
Good luck with this code.
Jim
; ------------------------------------------------------------------------------
;
; Written by: R. James Firby
;
; ------------------------------------------------------------------------------
; ** Patch to the T System so that errors don't kill the GPR System
; -----------------------------------------------------------------
;
; (1) Create a new error that doesn't choke when GPR running
; (2) Make the new error available in all the usual places
;
; This could be a lot more robust but should be fine for most users.
(set (*value t-implementation-env 'error)
(let ( (error-old (*value t-implementation-env 'error)) )
(lambda stuff
(receive (count okay)
(gpr_$force_release nil nil)
(ignore okay)
(unwind-protect
(apply error-old stuff)
(do ( (count count (fx- count 1)) )
((fx<= count 0) T)
(gpr_$acquire_display nil)))))))
(import t-implementation-env error)
-------