X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=include%2Fruntime.h;h=e453fecac9b9425123b05170c7e0c10f5b22df29;hp=8d9638ea055008b9182ca5bb1dd7ea76fe5323c4;hb=86fd9c8abfbacea2902b4fe42a8a4664b2a531cf;hpb=9ec5405d406696c6cbdb7a47ade7fccc736a8b53 diff --git a/include/runtime.h b/include/runtime.h index 8d9638e..e453fec 100644 --- a/include/runtime.h +++ b/include/runtime.h @@ -1,14 +1,18 @@ -/* +/* * Written by Josh Dybnis and released to the public domain, as explained at * http://creativecommons.org/licenses/publicdomain */ -#ifndef THREADS_H -#define THREADS_H +#ifndef RUNTIME_H +#define RUNTIME_H -void nbd_init (void); +#include +#include "tls.h" -int nbd_thread_create (pthread_t *restrict thread, int thread_id, void *(*start_routine)(void *), void *restrict arg); +extern DECLARE_THREAD_LOCAL(tid_, int); -void rcu_update (void); +int nbd_thread_create (pthread_t *restrict thread, int thread_id, void *(*start_routine)(void *), void *restrict arg); +uint64_t nbd_rand (void); +uint64_t nbd_rand_seed (int i); +int nbd_next_rand (uint64_t *r); -#endif//THREADS_H +#endif//RUNTIME_H