*/
#include <string.h>
#include "common.h"
-#include "rcu.h"
+#include "runtime_local.h"
#include "lwt.h"
#include "mem.h"
-#include "nbd.h"
#include "tls.h"
#define RCU_POST_THRESHOLD 10
}
#ifdef MAKE_rcu_test
-#include <pthread.h>
#include <errno.h>
#include <stdio.h>
+#include "runtime.h"
#define NUM_ITERATIONS 10000000
void *worker (void *arg) {
int id = (int)(size_t)arg;
unsigned int rand_seed = (unsigned int)id + 1;
- nbd_thread_init(id);
// Wait for all the worker threads to be ready.
__sync_fetch_and_add(&wait_, -1);
pthread_t thread[num_threads];
for (int i = 0; i < num_threads; ++i) {
- int rc = pthread_create(thread + i, NULL, worker, (void *)(size_t)i);
+ int rc = nbd_thread_create(thread + i, i, worker, (void *)(size_t)i);
if (rc != 0) { perror("pthread_create"); return rc; }
}
for (int i = 0; i < num_threads; ++i) {