svn commit: branches/uClibc_0_9_29/libpthread/linuxthreads.old: sysdeps/pthread

vapier at uclibc.org vapier at uclibc.org
Sat Jan 5 17:54:18 UTC 2008


Author: vapier
Date: 2008-01-05 09:54:17 -0800 (Sat, 05 Jan 2008)
New Revision: 20788

Log:
Merge r20474 by bernds from trunk:
Add hidden symbols for a number of pthread functions, and use them to ensure
that all entries in the __pthread_functions point to functions within
libpthread, not identically-named functions in libc.


Modified:
   branches/uClibc_0_9_29/libpthread/linuxthreads.old/attr.c
   branches/uClibc_0_9_29/libpthread/linuxthreads.old/cancel.c
   branches/uClibc_0_9_29/libpthread/linuxthreads.old/condvar.c
   branches/uClibc_0_9_29/libpthread/linuxthreads.old/join.c
   branches/uClibc_0_9_29/libpthread/linuxthreads.old/pthread.c
   branches/uClibc_0_9_29/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h


Changeset:
Modified: branches/uClibc_0_9_29/libpthread/linuxthreads.old/attr.c
===================================================================
--- branches/uClibc_0_9_29/libpthread/linuxthreads.old/attr.c	2008-01-05 17:53:44 UTC (rev 20787)
+++ branches/uClibc_0_9_29/libpthread/linuxthreads.old/attr.c	2008-01-05 17:54:17 UTC (rev 20788)
@@ -25,6 +25,19 @@
 #include "pthread.h"
 #include "internals.h"
 
+libpthread_hidden_proto(pthread_attr_destroy)
+libpthread_hidden_proto(pthread_attr_init)
+libpthread_hidden_proto(pthread_attr_getdetachstate)
+libpthread_hidden_proto(pthread_attr_setdetachstate)
+libpthread_hidden_proto(pthread_attr_getinheritsched)
+libpthread_hidden_proto(pthread_attr_setinheritsched)
+libpthread_hidden_proto(pthread_attr_setschedparam)
+libpthread_hidden_proto(pthread_attr_getschedparam)
+libpthread_hidden_proto(pthread_attr_getschedpolicy)
+libpthread_hidden_proto(pthread_attr_setschedpolicy)
+libpthread_hidden_proto(pthread_attr_getscope)
+libpthread_hidden_proto(pthread_attr_setscope)
+
 /* NOTE: With uClibc I don't think we need this versioning stuff.
  * Therefore, define the function pthread_attr_init() here using
  * a strong symbol. */
@@ -45,6 +58,7 @@
   attr->__stacksize = STACK_SIZE - ps;
   return 0;
 }
+libpthread_hidden_def(pthread_attr_init)
 
 /* uClibc: leave out this for now. */
 #if DO_PTHREAD_VERSIONING_WITH_UCLIBC
@@ -70,7 +84,9 @@
 {
   return 0;
 }
+libpthread_hidden_def(pthread_attr_destroy)
 
+
 int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
 {
   if (detachstate < PTHREAD_CREATE_JOINABLE ||
@@ -79,12 +95,14 @@
   attr->__detachstate = detachstate;
   return 0;
 }
+libpthread_hidden_def(pthread_attr_setdetachstate)
 
 int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate)
 {
   *detachstate = attr->__detachstate;
   return 0;
 }
+libpthread_hidden_def(pthread_attr_getdetachstate)
 
 int pthread_attr_setschedparam(pthread_attr_t *attr,
                                const struct sched_param *param)
@@ -97,6 +115,7 @@
   memcpy (&attr->__schedparam, param, sizeof (struct sched_param));
   return 0;
 }
+libpthread_hidden_def(pthread_attr_setschedparam)
 
 int pthread_attr_getschedparam(const pthread_attr_t *attr,
                                struct sched_param *param)
@@ -104,6 +123,7 @@
   memcpy (param, &attr->__schedparam, sizeof (struct sched_param));
   return 0;
 }
+libpthread_hidden_def(pthread_attr_getschedparam)
 
 int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
 {
@@ -112,12 +132,14 @@
   attr->__schedpolicy = policy;
   return 0;
 }
+libpthread_hidden_def(pthread_attr_setschedpolicy)
 
 int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
 {
   *policy = attr->__schedpolicy;
   return 0;
 }
+libpthread_hidden_def(pthread_attr_getschedpolicy)
 
 int pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit)
 {
@@ -126,12 +148,14 @@
   attr->__inheritsched = inherit;
   return 0;
 }
+libpthread_hidden_def(pthread_attr_setinheritsched)
 
 int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit)
 {
   *inherit = attr->__inheritsched;
   return 0;
 }
+libpthread_hidden_def(pthread_attr_getinheritsched)
 
 int pthread_attr_setscope(pthread_attr_t *attr, int scope)
 {
@@ -145,12 +169,14 @@
     return EINVAL;
   }
 }
+libpthread_hidden_def(pthread_attr_setscope)
 
 int pthread_attr_getscope(const pthread_attr_t *attr, int *scope)
 {
   *scope = attr->__scope;
   return 0;
 }
+libpthread_hidden_def(pthread_attr_getscope)
 
 int __pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize)
 {

Modified: branches/uClibc_0_9_29/libpthread/linuxthreads.old/cancel.c
===================================================================
--- branches/uClibc_0_9_29/libpthread/linuxthreads.old/cancel.c	2008-01-05 17:53:44 UTC (rev 20787)
+++ branches/uClibc_0_9_29/libpthread/linuxthreads.old/cancel.c	2008-01-05 17:54:17 UTC (rev 20788)
@@ -37,6 +37,8 @@
 # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
 #endif
 
+libpthread_hidden_proto(pthread_setcancelstate)
+libpthread_hidden_proto(pthread_setcanceltype)
 
 int pthread_setcancelstate(int state, int * oldstate)
 {
@@ -51,6 +53,7 @@
     __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME);
   return 0;
 }
+libpthread_hidden_def(pthread_setcancelstate)
 
 int pthread_setcanceltype(int type, int * oldtype)
 {
@@ -65,6 +68,7 @@
     __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME);
   return 0;
 }
+libpthread_hidden_def(pthread_setcanceltype)
 
 int pthread_cancel(pthread_t thread)
 {
@@ -165,6 +169,7 @@
   THREAD_SETMEM(self, p_canceltype, PTHREAD_CANCEL_DEFERRED);
   THREAD_SETMEM(self, p_cleanup, buffer);
 }
+strong_alias(_pthread_cleanup_push_defer,__pthread_cleanup_push_defer)
 
 void _pthread_cleanup_pop_restore(struct _pthread_cleanup_buffer * buffer,
 				  int execute)
@@ -178,7 +183,9 @@
       THREAD_GETMEM(self, p_canceltype) == PTHREAD_CANCEL_ASYNCHRONOUS)
     __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME);
 }
+strong_alias(_pthread_cleanup_pop_restore,__pthread_cleanup_pop_restore)
 
+
 void __pthread_perform_cleanup(char *currentframe)
 {
   pthread_descr self = thread_self();

Modified: branches/uClibc_0_9_29/libpthread/linuxthreads.old/condvar.c
===================================================================
--- branches/uClibc_0_9_29/libpthread/linuxthreads.old/condvar.c	2008-01-05 17:53:44 UTC (rev 20787)
+++ branches/uClibc_0_9_29/libpthread/linuxthreads.old/condvar.c	2008-01-05 17:54:17 UTC (rev 20788)
@@ -25,6 +25,16 @@
 #include "queue.h"
 #include "restart.h"
 
+libpthread_hidden_proto(pthread_cond_broadcast)
+libpthread_hidden_proto(pthread_cond_destroy)
+libpthread_hidden_proto(pthread_cond_init)
+libpthread_hidden_proto(pthread_cond_signal)
+libpthread_hidden_proto(pthread_cond_wait)
+libpthread_hidden_proto(pthread_cond_timedwait)
+
+libpthread_hidden_proto(pthread_condattr_destroy)
+libpthread_hidden_proto(pthread_condattr_init)
+
 int pthread_cond_init(pthread_cond_t *cond,
                       const pthread_condattr_t *cond_attr attribute_unused)
 {
@@ -32,12 +42,14 @@
   cond->__c_waiting = NULL;
   return 0;
 }
+libpthread_hidden_def(pthread_cond_init)
 
 int pthread_cond_destroy(pthread_cond_t *cond)
 {
   if (cond->__c_waiting != NULL) return EBUSY;
   return 0;
 }
+libpthread_hidden_def(pthread_cond_destroy)
 
 /* Function called by pthread_cancel to remove the thread from
    waiting on a condition variable queue. */
@@ -132,6 +144,7 @@
   __pthread_mutex_lock(mutex);
   return 0;
 }
+libpthread_hidden_def(pthread_cond_wait)
 
 static int
 pthread_cond_timedwait_relative(pthread_cond_t *cond,
@@ -233,6 +246,7 @@
   /* Indirect call through pointer! */
   return pthread_cond_timedwait_relative(cond, mutex, abstime);
 }
+libpthread_hidden_def(pthread_cond_timedwait)
 
 int pthread_cond_signal(pthread_cond_t *cond)
 {
@@ -248,6 +262,7 @@
   }
   return 0;
 }
+libpthread_hidden_def(pthread_cond_signal)
 
 int pthread_cond_broadcast(pthread_cond_t *cond)
 {
@@ -266,16 +281,19 @@
   }
   return 0;
 }
+libpthread_hidden_def(pthread_cond_broadcast)
 
 int pthread_condattr_init(pthread_condattr_t *attr attribute_unused)
 {
   return 0;
 }
+libpthread_hidden_def(pthread_condattr_init)
 
 int pthread_condattr_destroy(pthread_condattr_t *attr attribute_unused)
 {
   return 0;
 }
+libpthread_hidden_def(pthread_condattr_destroy)
 
 int pthread_condattr_getpshared (const pthread_condattr_t *attr attribute_unused, int *pshared)
 {

Modified: branches/uClibc_0_9_29/libpthread/linuxthreads.old/join.c
===================================================================
--- branches/uClibc_0_9_29/libpthread/linuxthreads.old/join.c	2008-01-05 17:53:44 UTC (rev 20787)
+++ branches/uClibc_0_9_29/libpthread/linuxthreads.old/join.c	2008-01-05 17:54:17 UTC (rev 20788)
@@ -25,10 +25,12 @@
 #include "restart.h"
 #include "debug.h" /* PDEBUG, added by StS */
 
+libpthread_hidden_proto (pthread_exit)
 void pthread_exit(void * retval)
 {
   __pthread_do_exit (retval, CURRENT_STACK_FRAME);
 }
+libpthread_hidden_def (pthread_exit)
 
 void __pthread_do_exit(void *retval, char *currentframe)
 {

Modified: branches/uClibc_0_9_29/libpthread/linuxthreads.old/pthread.c
===================================================================
--- branches/uClibc_0_9_29/libpthread/linuxthreads.old/pthread.c	2008-01-05 17:53:44 UTC (rev 20787)
+++ branches/uClibc_0_9_29/libpthread/linuxthreads.old/pthread.c	2008-01-05 17:54:17 UTC (rev 20788)
@@ -284,6 +284,41 @@
 
 static void pthread_initialize(void) __attribute__((constructor));
 
+libpthread_hidden_proto(pthread_attr_destroy)
+libpthread_hidden_proto(pthread_attr_init)
+libpthread_hidden_proto(pthread_attr_getdetachstate)
+libpthread_hidden_proto(pthread_attr_setdetachstate)
+libpthread_hidden_proto(pthread_attr_getinheritsched)
+libpthread_hidden_proto(pthread_attr_setinheritsched)
+libpthread_hidden_proto(pthread_attr_setschedparam)
+libpthread_hidden_proto(pthread_attr_getschedparam)
+libpthread_hidden_proto(pthread_attr_getschedpolicy)
+libpthread_hidden_proto(pthread_attr_setschedpolicy)
+libpthread_hidden_proto(pthread_attr_getscope)
+libpthread_hidden_proto(pthread_attr_setscope)
+
+libpthread_hidden_proto(pthread_exit)
+
+libpthread_hidden_proto(pthread_equal)
+libpthread_hidden_proto(pthread_self)
+libpthread_hidden_proto(pthread_getschedparam)
+libpthread_hidden_proto(pthread_setschedparam)
+
+libpthread_hidden_proto(pthread_setcancelstate)
+libpthread_hidden_proto(pthread_setcanceltype)
+libpthread_hidden_proto(_pthread_cleanup_push_defer)
+libpthread_hidden_proto(_pthread_cleanup_pop_restore)
+
+libpthread_hidden_proto(pthread_cond_broadcast)
+libpthread_hidden_proto(pthread_cond_destroy)
+libpthread_hidden_proto(pthread_cond_init)
+libpthread_hidden_proto(pthread_cond_signal)
+libpthread_hidden_proto(pthread_cond_wait)
+libpthread_hidden_proto(pthread_cond_timedwait)
+
+libpthread_hidden_proto(pthread_condattr_destroy)
+libpthread_hidden_proto(pthread_condattr_init)
+
 struct pthread_functions __pthread_functions =
   {
 #if !(USE_TLS && HAVE___THREAD)
@@ -638,11 +673,13 @@
   pthread_descr self = thread_self();
   return THREAD_GETMEM(self, p_tid);
 }
-
+libpthread_hidden_def (pthread_self)
+    
 int pthread_equal(pthread_t thread1, pthread_t thread2)
 {
   return thread1 == thread2;
 }
+libpthread_hidden_def (pthread_equal)
 
 /* Helper function for thread_self in the case of user-provided stacks */
 
@@ -714,6 +751,7 @@
     __pthread_manager_adjust_prio(th->p_priority);
   return 0;
 }
+libpthread_hidden_def(pthread_setschedparam)
 
 int pthread_getschedparam(pthread_t thread, int *policy,
                           struct sched_param *param)
@@ -734,6 +772,7 @@
   *policy = pol;
   return 0;
 }
+libpthread_hidden_def(pthread_getschedparam)
 
 /* Process-wide exit() request */
 

Modified: branches/uClibc_0_9_29/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h
===================================================================
--- branches/uClibc_0_9_29/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h	2008-01-05 17:53:44 UTC (rev 20787)
+++ branches/uClibc_0_9_29/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h	2008-01-05 17:54:17 UTC (rev 20788)
@@ -635,6 +635,9 @@
 extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
 					 void (*__routine) (void *),
 					 void *__arg) __THROW;
+extern void __pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
+					  void (*__routine) (void *),
+					  void *__arg) __THROW;
 
 /* Remove a cleanup handler as pthread_cleanup_pop does, but also
    restores the cancellation type that was in effect when the matching
@@ -645,6 +648,8 @@
 
 extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
 					  int __execute) __THROW;
+extern void __pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
+					   int __execute) __THROW;
 #endif
 
 




More information about the uClibc-cvs mailing list