X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=struct%2Fht_test.c;h=c7e6d57c1d34c59f9cd4ae2ce89750f1e544e0d1;hb=053576b00e7d37f19ce99f033e9981761d647c1f;hp=61b2bfc29a432d6556586489cbc2721b35b0bbb9;hpb=4a7804bd08c790fc3c4233312e4b485c3302fe02;p=nbds diff --git a/struct/ht_test.c b/struct/ht_test.c index 61b2bfc..c7e6d57 100644 --- a/struct/ht_test.c +++ b/struct/ht_test.c @@ -4,10 +4,9 @@ */ #include #include +#include "runtime.h" #include "CuTest.h" #include "common.h" -#include "nbd.h" -#include "rcu.h" #include "ht.h" #include "mem.h" @@ -96,7 +95,6 @@ void *simple_worker (void *arg) { uint64_t d = wd->id; int iters = 20000; - nbd_thread_init(d); SYNC_ADD(wd->wait, -1); do { } while (*((volatile worker_data_t *)wd)->wait); // wait for all workers to be ready @@ -132,8 +130,8 @@ void simple_add_remove (CuTest* tc) { wd[i].tc = tc; wd[i].ht = ht; wd[i].wait = &wait; - int rc = pthread_create(thread + i, NULL, simple_worker, wd + i); - if (rc != 0) { perror("pthread_create"); return; } + int rc = nbd_thread_create(thread + i, i, simple_worker, wd + i); + if (rc != 0) { perror("nbd_thread_create"); return; } } for (i = 0; i < 2; ++i) { pthread_join(thread[i], NULL); @@ -161,8 +159,6 @@ void concurrent_insert (CuTest* tc) { int main (void) { nbd_init(); - nbd_thread_init(0); - //lwt_set_trace_level("h4"); // Create and run test suite