]> pd.if.org Git - nbds/blobdiff - runtime/runtime.c
revert to working upstream version, fix osx build
[nbds] / runtime / runtime.c
index fe4a1bd894a6dc09d776ffbbb8276d1f7ce2605f..5f6b8d94d0965f85c3fa5c2166b3bd66afd515f1 100644 (file)
@@ -24,7 +24,7 @@ typedef struct thread_info {
 } thread_info_t;
 
 __attribute__ ((constructor)) void nbd_init (void) {
-    INIT_THREAD_LOCAL(r);
+    //    INIT_THREAD_LOCAL(r);
     INIT_THREAD_LOCAL(tid_);
     SET_THREAD_LOCAL(tid_, 0);
     mem_init();
@@ -36,7 +36,7 @@ __attribute__ ((constructor)) void nbd_init (void) {
 static void *worker (void *arg) {
     thread_info_t *ti = (thread_info_t *)arg;
     SET_THREAD_LOCAL(tid_, ti->thread_id);
-    LOCALIZE_THREAD_LOCAL(tid_, int);
+    //LOCALIZE_THREAD_LOCAL(tid_, int);
 
     SET_THREAD_LOCAL(rx_, rand());
     SET_THREAD_LOCAL(ry_, rand());
@@ -78,7 +78,7 @@ uint64_t nbd_rand (void) {
     SET_THREAD_LOCAL(rx_, rx);
     SET_THREAD_LOCAL(ry_, ry);
     SET_THREAD_LOCAL(rz_, rz);
-    SET_THREAD_LOCAL(rc_, t >> 32);
+    SET_THREAD_LOCAL(rc_, (unsigned)(t >> 32));
 
     return r;
 }