summaryrefslogtreecommitdiffstats
path: root/libpthread/linuxthreads/condvar.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-09-13 02:28:34 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-09-13 02:28:34 +0000
commit07a485defae1ef578c5b3ce0d4373201948a7345 (patch)
tree2184f0f32083bd47ef3b82ad016d8d710f8f221f /libpthread/linuxthreads/condvar.c
parent224ca9f63688cdecd80ed01c25f5f62871fe4cfc (diff)
downloaduClibc-alpine-07a485defae1ef578c5b3ce0d4373201948a7345.tar.bz2
uClibc-alpine-07a485defae1ef578c5b3ce0d4373201948a7345.tar.xz
Merge with trunk. "So do that funky merge whiiite boy..."
Diffstat (limited to 'libpthread/linuxthreads/condvar.c')
-rw-r--r--libpthread/linuxthreads/condvar.c103
1 files changed, 89 insertions, 14 deletions
diff --git a/libpthread/linuxthreads/condvar.c b/libpthread/linuxthreads/condvar.c
index f9c46a331..b051afd4c 100644
--- a/libpthread/linuxthreads/condvar.c
+++ b/libpthread/linuxthreads/condvar.c
@@ -25,19 +25,52 @@
#include "queue.h"
#include "restart.h"
-int pthread_cond_init(pthread_cond_t *cond,
- const pthread_condattr_t *cond_attr)
+/* glibc uses strong aliases, we wont bother */
+#undef strong_alias
+#define strong_alias(sym, alias)
+#define __pthread_cond_init pthread_cond_init
+#define __pthread_cond_destroy pthread_cond_destroy
+#define __pthread_cond_wait pthread_cond_wait
+#define __pthread_cond_timedwait pthread_cond_timedwait
+#define __pthread_cond_signal pthread_cond_signal
+#define __pthread_cond_broadcast pthread_cond_broadcast
+#define __pthread_condattr_init pthread_condattr_init
+#define __pthread_condattr_destroy pthread_condattr_destroy
+
+
+int __pthread_cond_init(pthread_cond_t *cond,
+ const pthread_condattr_t *cond_attr)
{
__pthread_init_lock(&cond->__c_lock);
cond->__c_waiting = NULL;
return 0;
}
-
-int pthread_cond_destroy(pthread_cond_t *cond)
+/* Don't bother with this version stuff in uClibc */
+#if 0
+versioned_symbol (libpthread, __pthread_cond_init, pthread_cond_init,
+ GLIBC_2_3_2);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+strong_alias (__pthread_cond_init, __old_pthread_cond_init)
+compat_symbol (libpthread, __old_pthread_cond_init, pthread_cond_init,
+ GLIBC_2_0);
+#endif
+#endif
+
+int __pthread_cond_destroy(pthread_cond_t *cond)
{
if (cond->__c_waiting != NULL) return EBUSY;
return 0;
}
+/* Don't bother with this version stuff in uClibc */
+#if 0
+versioned_symbol (libpthread, __pthread_cond_destroy, pthread_cond_destroy,
+ GLIBC_2_3_2);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+strong_alias (__pthread_cond_destroy, __old_pthread_cond_destroy)
+compat_symbol (libpthread, __old_pthread_cond_destroy, pthread_cond_destroy,
+ GLIBC_2_0);
+#endif
+#endif
/* Function called by pthread_cancel to remove the thread from
waiting on a condition variable queue. */
@@ -55,7 +88,7 @@ static int cond_extricate_func(void *obj, pthread_descr th)
return did_remove;
}
-int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
+int __pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
volatile pthread_descr self = thread_self();
pthread_extricate_if extr;
@@ -132,6 +165,16 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
pthread_mutex_lock(mutex);
return 0;
}
+/* Don't bother with this version stuff in uClibc */
+#if 0
+versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
+ GLIBC_2_3_2);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+strong_alias (__pthread_cond_wait, __old_pthread_cond_wait)
+compat_symbol (libpthread, __old_pthread_cond_wait, pthread_cond_wait,
+ GLIBC_2_0);
+#endif
+#endif
static int
pthread_cond_timedwait_relative(pthread_cond_t *cond,
@@ -227,14 +270,24 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
return 0;
}
-int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
- const struct timespec * abstime)
+int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+ const struct timespec * abstime)
{
/* Indirect call through pointer! */
return pthread_cond_timedwait_relative(cond, mutex, abstime);
}
-
-int pthread_cond_signal(pthread_cond_t *cond)
+/* Don't bother with this version stuff in uClibc */
+#if 0
+versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
+ GLIBC_2_3_2);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+strong_alias (__pthread_cond_timedwait, __old_pthread_cond_timedwait)
+compat_symbol (libpthread, __old_pthread_cond_timedwait,
+ pthread_cond_timedwait, GLIBC_2_0);
+#endif
+#endif
+
+int __pthread_cond_signal(pthread_cond_t *cond)
{
pthread_descr th;
@@ -248,8 +301,18 @@ int pthread_cond_signal(pthread_cond_t *cond)
}
return 0;
}
-
-int pthread_cond_broadcast(pthread_cond_t *cond)
+/* Don't bother with this version stuff in uClibc */
+#if 0
+versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal,
+ GLIBC_2_3_2);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+strong_alias (__pthread_cond_signal, __old_pthread_cond_signal)
+compat_symbol (libpthread, __old_pthread_cond_signal, pthread_cond_signal,
+ GLIBC_2_0);
+#endif
+#endif
+
+int __pthread_cond_broadcast(pthread_cond_t *cond)
{
pthread_descr tosignal, th;
@@ -266,16 +329,28 @@ int pthread_cond_broadcast(pthread_cond_t *cond)
}
return 0;
}
-
-int pthread_condattr_init(pthread_condattr_t *attr)
+/* Don't bother with this version stuff in uClibc */
+#if 0
+versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
+ GLIBC_2_3_2);
+#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
+strong_alias (__pthread_cond_broadcast, __old_pthread_cond_broadcast)
+compat_symbol (libpthread, __old_pthread_cond_broadcast,
+ pthread_cond_broadcast, GLIBC_2_0);
+#endif
+#endif
+
+int __pthread_condattr_init(pthread_condattr_t *attr)
{
return 0;
}
+strong_alias (__pthread_condattr_init, pthread_condattr_init)
-int pthread_condattr_destroy(pthread_condattr_t *attr)
+int __pthread_condattr_destroy(pthread_condattr_t *attr)
{
return 0;
}
+strong_alias (__pthread_condattr_destroy, pthread_condattr_destroy)
int pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared)
{