shithub: mc

Download patch

ref: bccdc9c4492e0270322b0b0ab81fa509c5390ab2
parent: 107e78e61117bdadc667fb5bdece373b90a26015
author: Ori Bernstein <ori@eigenstate.org>
date: Thu May 12 16:22:23 EDT 2016

Install thread hooks in libstd

    Looks like the file wasn't properly added.

--- a/lib/thread/bld.sub
+++ b/lib/thread/bld.sub
@@ -1,5 +1,6 @@
 lib thread =
 	common.myr
+	hookstd.myr    # install thread hooks
 
 	# linux impl of basic thread primitives
 	#condvar+linux.myr
--- /dev/null
+++ b/lib/thread/hookstd.myr
@@ -1,0 +1,23 @@
+use std
+use "mutex"
+
+pkg thread =
+;;
+
+var memlck
+var netlck
+var envlck
+
+const __init__ = {
+	memlck = mkmtx()
+	netlck = mkmtx()
+	envlck = mkmtx()
+	std.__lockinit( \
+		&memlck castto(void#), \
+		&netlck castto(void#), \
+		&envlck castto(void#), \
+		{mtx; mtxlock(mtx castto(mutex#))}, \
+		{mtx; mtxunlock(mtx castto(mutex#))} \
+	)
+}
+