From bef6322859a5dc01e35d884de7afd2eabb1d9e4d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 17 May 2007 22:22:53 +0000 Subject: at basic locking/threading support git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@26 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce --- once.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 once.h (limited to 'once.h') diff --git a/once.h b/once.h new file mode 100644 index 0000000..a374529 --- /dev/null +++ b/once.h @@ -0,0 +1,17 @@ +#ifndef foosydneyoncehfoo +#define foosydneyoncehfoo + +#include "mutex.h" + +typedef struct sa_once { + unsigned int once_value; + sa_mutex_t *mutex; +} sa_once_t; + +#define SA_ONCE_INIT { .once_value = 0, .mutex = NULL } + +typedef void (*sa_once_func_t) (void); + +int sa_once(sa_once_t *o, sa_once_func_t f); + +#endif -- cgit