The trick implemented in d20543b98a (see #137) seems to be racy. For instance, the following code eventually hangs in join-thread (in wait-condition-variable, called by join-thread) as of a2133d0a40:
./env guile -c '(use-modules (fibers)) (while #t (run-fibers (const #t)) (display "."))'
I think that’s because we cannot be sure the signal is sent at all (due to (when interrupt-thread ...) and also that the async queued by cancel-thread gets to run before (re)entering clock-nanosleep.
The trick implemented in d20543b98a341abc534c6449461ea85af973e7aa (see #137) seems to be racy. For instance, the following code eventually hangs in `join-thread` (in `wait-condition-variable`, called by `join-thread`) as of a2133d0a402836088a1f2df9dc88438eeeaabfc8:
```
./env guile -c '(use-modules (fibers)) (while #t (run-fibers (const #t)) (display "."))'
```
I think that’s because we cannot be sure the signal is sent at all (due to `(when interrupt-thread ...)` and also that the async queued by `cancel-thread` gets to run before (re)entering `clock-nanosleep`.