Created SILC Runtime Toolkit git repository Part II.
[runtime.git] / lib / silcutil / tests / test_silcmutex.c
index 49367adb9a0f4f740d428ccfa2b95f522c8779d9..e52e1aafa6e739cac0f0df25987039ce2c2a0468 100644 (file)
@@ -1,7 +1,7 @@
 /* Locking performance tests.  Gives locsk&unlocks/second. */
 /* Version 1.0 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 typedef struct {
   SilcThread thread;
@@ -18,7 +18,7 @@ SilcUInt64 cpu_freq = 0;
 int max_locks, max_locks2;
 SilcTimerStruct timer;
 
-#define rdtsc() silc_timer_tick(&timer)
+#define rdtsc() silc_timer_tick(&timer, FALSE)
 
 void *mutex_thread(void *context)
 {
@@ -84,6 +84,7 @@ int main(int argc, char **argv)
   sleep(1);
   val = rdtsc() - val;
   val /= 1000;                 /* Gives us milliseconds */
+  cpu_freq = val;
   fprintf(stderr, "CPU frequency: %llu\n", val);
 
   max_locks = MAX_LOCKS;
@@ -179,5 +180,5 @@ int main(int argc, char **argv)
 
   fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
 
-  return success;
+  return !success;
 }