Răsfoiți Sursa

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

Eric Andersen 23 ani în urmă
părinte
comite
fd19822e4d
2 a modificat fișierele cu 22 adăugiri și 22 ștergeri
  1. 20 20
      libc/inet/rpc/rpc_thread.c
  2. 2 2
      libpthread/linuxthreads/mutex.c

+ 20 - 20
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
  */

+ 2 - 2
libpthread/linuxthreads/mutex.c

@@ -195,7 +195,7 @@ static pthread_cond_t once_finished = PTHREAD_COND_INITIALIZER;
 
 enum { NEVER = 0, IN_PROGRESS = 1, DONE = 2 };
 
-int pthread_once(pthread_once_t * once_control, void (*init_routine)(void))
+int __pthread_once(pthread_once_t * once_control, void (*init_routine)(void))
 {
   /* Test without locking first for speed */
   if (*once_control == DONE) return 0;
@@ -218,4 +218,4 @@ int pthread_once(pthread_once_t * once_control, void (*init_routine)(void))
   pthread_mutex_unlock(&once_masterlock);
   return 0;
 }
-//strong_alias (__pthread_once, pthread_once)
+strong_alias (__pthread_once, pthread_once)