From e2354efc95efca2909429a2001cd910c9ce566fa Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 9 Oct 2012 19:08:01 -0700 Subject: [PATCH] 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. --- mcs-lock/mcs-lock.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.34.1