Hello, Alex,

I have a crazy idea to make a patch to PicoLisp that would allow
handling signals even during long native call (i. e. libcurl
download). The idea is to process signals immediately if PicoLisp not
in critical section of the code. I’m trying to modify `sig` function
in `main.l` as follows:

(de void sig ((i32 . N))
   (if (val $TtyPid)
      (kill @ N)
      (set $Signal (+ (val $Signal) 1))
-      (let P (ofs $Signal (gSignal N))
-         (set P (+ (val P) 1)) ) ) )
+      (if (val $Protect)
+         (let P (ofs $Signal (gSignal N))
+            (set P (+ (val P) 1)) )
+         (sighandler 0) ) ) )

However `sighandler` is undefined at this moment. I can’t move the
`sig` function after `sighandler`, since `sighandler` itself calls
`sig`.

So there are questions:

1. How should I handle this kind of recursion?
2. Does this idea seem reasonable to you?

Regards, Constantine

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to