mcs-lock: add trivial driver, link with build system
[model-checker-benchmarks.git] / mcs-lock / mcs-lock.cc
diff --git a/mcs-lock/mcs-lock.cc b/mcs-lock/mcs-lock.cc
new file mode 100644 (file)
index 0000000..135085f
--- /dev/null
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <threads.h>
+
+#include "mcs-lock.h"
+
+struct mcs_mutex *mutex;
+
+int user_main(int argc, char **argv)
+{
+       mcs_mutex::guard *g = new mcs_mutex::guard(mutex);
+       mutex->lock(g);
+       mutex->unlock(g);
+       return 0;
+}