ref: 34f2230c4a505f3b94bc33ed07f0839fe66a0e93
dir: /lib/thread/hookstd.myr/
use std use sys use "mutex" use "tls" pkg thread = ;; var memlck var netlck var envlck var stdtls const __init__ = { memlck = mkmtx() netlck = mkmtx() envlck = mkmtx() stdtls = tlsalloc() std.__lockinit( \ (&memlck : void#), \ (&netlck : void#), \ (&envlck : void#), \ {mtx; mtxlock((mtx : mutex#))}, \ {mtx; mtxunlock((mtx : mutex#))}, \ {; -> tlsget(stdtls)}, \ {val; tlsset(stdtls, val)} \ ) }