On Mon, Nov 14, 2022 at 9:11 AM Marc Nieper-Wißkirchen < marc.nie...@gmail.com> wrote:
> Thanks for taking a closer look at the recent changes! > > Am Mo., 14. Nov. 2022 um 20:05 Uhr schrieb Shiro Kawai < > shiro.ka...@gmail.com>: > > > > POSIX does not require pthread_cond_wait to be interrupted by a signal; > It does call a signal handler but can resume waiting, instead of returning > to the caller as most other system calls. That makes implementing > Schemel-evel thread-interrupt! difficult. > > SRFI 226 makes no guarantees when thread-interrupt! actually interrupts. > Ah, indeed. It just schedules for thunk to be called before the current continuation of the thread but you don't know when the current continuation will be executed. Likewise, there's no mention of what happens if thread-interrupt! is called on a thread that's waiting on mutex-lock! or thread-join!. Some more explanation may help the users. > Couldn't a thread store the POSIX condition variable it currently > waits on in a thread local? Thread-interrupt! will then just signal > this condition variable. > > Aha! Haven't thought of it. Yes, it seems to work. --shiro