From fd19822e4d58682ee95816c9e2f46094e4052edd Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sun, 11 Aug 2002 18:53:30 +0000 Subject: Ugh. Make uClibc cross compile with gcc 2.95.x and threads. I wonder if this is serious enough to warrent 0.9.14? -Erik --- libc/inet/rpc/rpc_thread.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'libc/inet/rpc/rpc_thread.c') diff --git a/libc/inet/rpc/rpc_thread.c b/libc/inet/rpc/rpc_thread.c index 90b0a6a2a..6c01af95c 100644 --- a/libc/inet/rpc/rpc_thread.c +++ b/libc/inet/rpc/rpc_thread.c @@ -12,25 +12,6 @@ static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem; static struct rpc_thread_variables *__libc_tsd_RPC_VARS_data = &__libc_tsd_RPC_VARS_mem; -extern int __pthread_once (pthread_once_t *__once_control, - void (*__init_routine) (void)); -asm (".weak __pthread_once"); - - -# define __libc_once_define(CLASS, NAME) \ - CLASS pthread_once_t NAME = PTHREAD_ONCE_INIT - -/* Call handler iff the first call. */ -#define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \ - do { \ - if (__pthread_once != NULL) \ - __pthread_once (&(ONCE_CONTROL), (INIT_FUNCTION)); \ - else if ((ONCE_CONTROL) == PTHREAD_ONCE_INIT) { \ - INIT_FUNCTION (); \ - (ONCE_CONTROL) = !PTHREAD_ONCE_INIT; \ - } \ - } while (0) - /* * Task-variable destructor */ @@ -54,8 +35,27 @@ __rpc_thread_destroy (void) } -#if 0 #warning fix multithreaded initialization... +#if 0 +extern int __pthread_once (pthread_once_t *__once_control, + void (*__init_routine) (void)); +asm (".weak __pthread_once"); + + +# define __libc_once_define(CLASS, NAME) \ + CLASS pthread_once_t NAME = PTHREAD_ONCE_INIT + +/* Call handler iff the first call. */ +#define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \ + do { \ + if (__pthread_once != NULL) \ + __pthread_once (&(ONCE_CONTROL), (INIT_FUNCTION)); \ + else if ((ONCE_CONTROL) == PTHREAD_ONCE_INIT) { \ + INIT_FUNCTION (); \ + (ONCE_CONTROL) = !PTHREAD_ONCE_INIT; \ + } \ + } while (0) + /* * Initialize RPC multi-threaded operation */ -- cgit v1.2.3