X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=test%2Fmap_test2.c;h=f8e0abd85b7f3958df026007b017c78db3d40729;hp=52438ea763364f5384b86aaf189cf0d87d6ff005;hb=75b0d2f02f548b3a1e4daba8b0d55eea2fb24e92;hpb=ff3c302d5e137d9653c656eee016bacf5d988d66 diff --git a/test/map_test2.c b/test/map_test2.c index 52438ea..f8e0abd 100644 --- a/test/map_test2.c +++ b/test/map_test2.c @@ -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 };