leonoel / missionary

A functional effect and streaming system for Clojure/Script
Eclipse Public License 2.0
636 stars 26 forks source link

`sleep` can run user code by a thread in interrupted state #115

Open leonoel opened 1 month ago

leonoel commented 1 month ago

The problematic scenario occurs when a sleep process is spawned in the termination callback of another sleep process.

Repro :

;; fails with InterruptedException
((m/reduce (fn [_ _] (Thread/sleep 0)) nil
   (m/ap (m/? (m/?> (m/seed (repeat (m/sleep 1)))))))
 prn prn)