]> pd.if.org Git - nbds/blobdiff - test/map_test2.c
work in progress
[nbds] / test / map_test2.c
index 52438ea763364f5384b86aaf189cf0d87d6ff005..f8e0abd85b7f3958df026007b017c78db3d40729 100644 (file)
@@ -132,6 +132,8 @@ void basic_test (CuTest* tc) {
 }
 
 void *add_remove_worker (void *arg) {
+    nbd_thread_init();
+
     worker_data_t *wd = (worker_data_t *)arg;
     map_t *map = wd->map;
     CuTest* tc = wd->tc;
@@ -197,7 +199,7 @@ void concurrent_add_remove_test (CuTest* tc) {
         wd[i].tc = tc;
         wd[i].map = map;
         wd[i].wait = &wait;
-        int rc = nbd_thread_create(thread + i, i, add_remove_worker, wd + i);
+        int rc = pthread_create(thread + i, NULL, add_remove_worker, wd + i);
         if (rc != 0) { perror("nbd_thread_create"); return; }
     }
 
@@ -207,7 +209,7 @@ void concurrent_add_remove_test (CuTest* tc) {
 
     gettimeofday(&tv2, NULL);
     int ms = (int)(1000000*(tv2.tv_sec - tv1.tv_sec) + tv2.tv_usec - tv1.tv_usec) / 1000;
-    map_print(map);
+    map_print(map, FALSE);
     printf("Time:%dms\n", ms);
     fflush(stdout);
 
@@ -315,6 +317,7 @@ void big_iteration_test (CuTest* tc) {
 }
 
 int main (void) {
+    nbd_thread_init();
     lwt_set_trace_level("r0m3l2t0");
 
     static const map_impl_t *map_types[] = { &MAP_IMPL_LL, &MAP_IMPL_SL, &MAP_IMPL_HT };