shithub: mc

ref: c191c8825c094e3563094104b80df47c735c95fa
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#))} \
	)
}