Fix virtual thread builder interop (#1810)
This commit is contained in:
parent
f33c68293b
commit
5b7678f309
3 changed files with 11 additions and 2 deletions
|
|
@ -7,6 +7,10 @@ A preview of the next release can be installed from
|
|||
|
||||
[Babashka](https://github.com/babashka/babashka): Native, fast starting Clojure interpreter for scripting
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Fix virtual `ThreadBuilder` interop
|
||||
|
||||
## 1.12.199 (2025-04-18)
|
||||
|
||||
- [#1806](https://github.com/babashka/babashka/issues/1806): Add `cheshire.factory` namespace ([@lread](https://github.com/lread))
|
||||
|
|
|
|||
|
|
@ -340,6 +340,7 @@
|
|||
java.lang.Throwable
|
||||
java.lang.ThreadLocal
|
||||
java.lang.Thread$UncaughtExceptionHandler
|
||||
java.lang.Thread$Builder
|
||||
java.lang.UnsupportedOperationException
|
||||
java.lang.ref.WeakReference
|
||||
java.lang.ref.ReferenceQueue
|
||||
|
|
@ -808,7 +809,8 @@
|
|||
(instance? org.jsoup.nodes.Element v)
|
||||
org.jsoup.nodes.Element
|
||||
;; keep commas for merge friendliness
|
||||
)]
|
||||
(instance? java.lang.Thread$Builder v)
|
||||
java.lang.Thread$Builder)]
|
||||
;; (prn :res res)
|
||||
res)))
|
||||
m (assoc m (list 'quote 'clojure.lang.Var) 'sci.lang.Var)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,10 @@
|
|||
(bb nil (pr-str '(do
|
||||
(def t (Thread. (fn [])))
|
||||
(def vt (Thread/startVirtualThread (fn [])))
|
||||
[(.isVirtual t) (.isVirtual vt)]))))))
|
||||
[(.isVirtual t) (.isVirtual vt)])))))
|
||||
(is (bb nil (pr-str '(instance?
|
||||
java.util.concurrent.Executor
|
||||
(java.util.concurrent.Executors/newThreadPerTaskExecutor (-> (Thread/ofVirtual) (.name "fusebox-thread-" 1) (.factory))))))))
|
||||
|
||||
(deftest domain-sockets-test
|
||||
(is (= :success (bb nil (slurp "test-resources/domain_sockets.bb")))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue