Scoped values polyfill
Andrew Haley
aph-open at littlepinkcloud.com
Sat Jan 18 09:11:20 UTC 2025
On 1/17/25 09:08, Davor Hrg wrote:
> I am looking to see if someone has a workaround that uses ThreadLocals in such way that is compatible with scoped values. (I do not need for structured concurrency, just a stack inside a single thread)
Sure, you just wrap ThreadLocal.set() and and ThreadLocal.remove() in a
try-finally. Or doe you need something more than that?
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the loom-dev
mailing list