shithub: mc

ref: 52eca667bbd1cf5a929d3f2352c3c1ee8e91625d
dir: /lib/thread/hookstd.myr/

View raw version
use std
use "mutex"

pkg thread =
;;

var memlck
var netlck
var envlck

const __init__ = {
	memlck = mkmtx()
	netlck = mkmtx()
	envlck = mkmtx()
	std.__lockinit( \
		(&memlck : void#), \
		(&netlck : void#), \
		(&envlck : void#), \
		{mtx; mtxlock((mtx : mutex#))}, \
		{mtx; mtxunlock((mtx : mutex#))} \
	)
}