|
@@ -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
|
|
|
-
|
|
|
-
|
|
|
-#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
|
|
|
+
|
|
|
+
|
|
|
+#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
|
|
|
*/
|