rontolisp:current-thread
(rontolisp:current-thread)
Returns the calling thread's own opaque thread handle. It works for any thread —
the main thread and served requests included, not only
rontolisp:make-thread spawns — and it is eq-stable:
repeated calls from one thread return the same handle, so it can key an eq hash
table. That property is what the bt2:current-thread shim (and through it dbi's
per-thread connection cache) relies on. Inside a thread
rontolisp:make-thread spawned, it is the handle make-thread
returned.
Threads are real on the interpreter and the JVM backend. Both WASM backends are
single-threaded by construction and do not compile this function; the
bordeaux-threads/bt2 shim's current-thread signals a clear error there at call
time.
Limitations
- Passing your own handle to
rontolisp:join-threadblocks forever (joining yourself does upstream too).