class fix for modernistic compilers
[feisty_meow.git] / nucleus / library / tests_basis / test_mutex.cpp
index 743e000406763f94a08680323c25531681d45742..86175c4ed0b4213e4bb8bd4aa69744c11e930dd1 100644 (file)
@@ -136,7 +136,7 @@ public:
       // we grab the lock.
       auto_synchronizer locked(guard());
         // in this case, we make use of auto-synchronizer, handily testing it as well.
-      ASSERT_TRUE(&locked != NIL, "auto_synchronizer should grab the mutex object's lock");
+      ASSERT_TRUE(&locked != NULL_POINTER, "auto_synchronizer should grab the mutex object's lock");
         // this is not a real test, but indicates that we did actually increase the number of
         // unit tests by one, since we're using auto_synchronizer now.
       safe_add(grab_lock, 1);
@@ -214,6 +214,10 @@ int test_mutex::execute()
 {
   FUNCDEF("execute");
 
+  // make sure the guard is initialized before the threads run.
+  guard().lock();
+  guard().unlock();
+
   {
     // we check how long a lock and unlock of a non-locked mutex will take.
     // this is important to know so that we aren't spending much of our time
@@ -234,21 +238,17 @@ int test_mutex::execute()
     ASSERT_TRUE(time_per_lock < 1.0, "mutex lock timing should be super fast");
   }
 
-  // make sure the guard is initialized before the threads run.
-  guard().lock();
-  guard().unlock();
-
   amorph<ethread> thread_list;
 
   for (int i = 0; i < DEFAULT_FISH; i++) {
-    ethread *t = NIL;
+    ethread *t = NULL_POINTER;
     if (i % 2) t = new piranha(*this);
     else t = new barracuda(*this);
     thread_list.append(t);
     ethread *q = thread_list[thread_list.elements() - 1];
     ASSERT_EQUAL(q, t, "amorph pointer equivalence is required");
     // start the thread we added.
-    thread_list[thread_list.elements() - 1]->start(NIL);
+    q->start(NULL_POINTER);
   }
 
   time_stamp when_to_leave(DEFAULT_RUN_TIME);