From: Brian Norris Date: Wed, 10 Oct 2012 01:09:20 +0000 (-0700) Subject: mcs-lock: add trivial driver, link with build system X-Git-Tag: pldi2013~56 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=commitdiff_plain;h=43509b349e5d7e4d7044ec462cebe11535d9dd54 mcs-lock: add trivial driver, link with build system This benchmark doesn't do much yet. --- diff --git a/Makefile b/Makefile index 26349f7..028a946 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -DIRS := barrier +DIRS := barrier mcs-lock .PHONY: subdirs $(DIRS) diff --git a/mcs-lock/Makefile b/mcs-lock/Makefile new file mode 100644 index 0000000..04d2398 --- /dev/null +++ b/mcs-lock/Makefile @@ -0,0 +1,11 @@ +include ../benchmarks.mk + +TESTNAME = mcs-lock + +all: $(TESTNAME) + +$(TESTNAME): $(TESTNAME).cc $(TESTNAME).h + $(CXX) -o $@ $< $(CPPFLAGS) $(LDFLAGS) + +clean: + rm -f $(TESTNAME) *.o diff --git a/mcs-lock/mcs-lock.cc b/mcs-lock/mcs-lock.cc new file mode 100644 index 0000000..135085f --- /dev/null +++ b/mcs-lock/mcs-lock.cc @@ -0,0 +1,14 @@ +#include +#include + +#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; +}