Displaying 2 results from an estimated 2 matches for "once_control".
2008 May 22
0
[PATCH] stubdom: fix and clean pthread minimal support
...id (*destr_function)(void*)) { *key = NULL; return 0; }
-static inline int pthread_setspecific(pthread_key_t *key, const void *pointer) { *key = (void*) pointer; return 0; }
-static inline void *pthread_getspecific(pthread_key_t *key) { return *key; }
-static inline int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) { init_routine(); return 0; }
+
+
+
+typedef struct {
+ int done;
+} pthread_once_t;
+#define PTHREAD_ONCE_INIT { 0 }
+
+static inline int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
+{
+ if (!once_control->done) {
+ once_contr...
2019 Jan 10
2
auth core dump