From 101c1b6a946d9f2f48c6dd89940ae669141e0511 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 22 Dec 2016 01:57:10 -0800 Subject: Use C99 structure initializers FTW. Various other changes. --- src/core/platform.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core/platform.h') diff --git a/src/core/platform.h b/src/core/platform.h index 00401493..104a94a0 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -64,6 +64,9 @@ typedef struct nni_mutex * nni_mutex_t; typedef struct nni_cond * nni_cond_t; // Mutex handling. +extern int nni_mutex_init(nni_mutex *); +extern void nni_mutex_fini(nni_mutex *); + extern int nni_mutex_create(nni_mutex_t *); extern void nni_mutex_destroy(nni_mutex_t); @@ -96,15 +99,16 @@ extern void nni_cond_wait(nni_cond_t); extern int nni_cond_timedwait(nni_cond_t, uint64_t); typedef struct nni_thread * nni_thread_t; +typedef struct nni_thread nni_thread; // nni_thread_creates a thread that runs the given function. The thread // receives a single argument. -extern int nni_thread_create(nni_thread_t *, void (*fn)(void *), void *); +extern int nni_thread_create(nni_thread **, void (*fn)(void *), void *); // nni_thread_reap waits for the thread to exit, and then releases any // resources associated with the thread. After this returns, it // is an error to reference the thread in any further way. -extern void nni_thread_reap(nni_thread_t); +extern void nni_thread_reap(nni_thread *); // nn_clock returns a number of microseconds since some arbitrary time // in the past. The values returned by nni_clock may be used with -- cgit v1.2.3-70-g09d2