From: Brian Norris Date: Wed, 10 Oct 2012 02:08:01 +0000 (-0700) Subject: mcs-lock: bugfix - didn't allocate mcs_mutex X-Git-Tag: pldi2013~53 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=commitdiff_plain;h=e2354efc95efca2909429a2001cd910c9ce566fa mcs-lock: bugfix - didn't allocate mcs_mutex This is a bug in the stupid driver I wrote (i.e., my fault). I was struggling with the syntax, so I forgot to even initialize my objects. --- diff --git a/mcs-lock/mcs-lock.cc b/mcs-lock/mcs-lock.cc index 135085f..6ba8f18 100644 --- a/mcs-lock/mcs-lock.cc +++ b/mcs-lock/mcs-lock.cc @@ -3,12 +3,12 @@ #include "mcs-lock.h" -struct mcs_mutex *mutex; +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); + mcs_mutex::guard *g = new mcs_mutex::guard(&mutex); + mutex.lock(g); + mutex.unlock(g); return 0; }