diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-05-17 22:22:53 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-05-17 22:22:53 +0000 |
commit | bef6322859a5dc01e35d884de7afd2eabb1d9e4d (patch) | |
tree | 6431f409747005fca20998fe518c174c909fd385 /once.h | |
parent | c58ce0879c1cabfd31dd8657d2594d78f13b1360 (diff) |
at basic locking/threading support
git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@26 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce
Diffstat (limited to 'once.h')
-rw-r--r-- | once.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 |