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.
#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;
}