summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads.old/semaphore.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-26 23:35:32 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:43 +0200
commite7575150911d8ee230d17ab7c03864df24a8be07 (patch)
tree72699cf46eb41dcd1f6448f97a47213634511229 /libpthread/linuxthreads.old/semaphore.c
parentd60ef5b6d8b6c8fb1650e351028aa2fbd41488e8 (diff)
linuxthreads.old: remove __old_sem_* and rename __new_sem_* to sem_*
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libpthread/linuxthreads.old/semaphore.c')
-rw-r--r--libpthread/linuxthreads.old/semaphore.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/libpthread/linuxthreads.old/semaphore.c b/libpthread/linuxthreads.old/semaphore.c
index 0811e1707..9025dfee6 100644
--- a/libpthread/linuxthreads.old/semaphore.c
+++ b/libpthread/linuxthreads.old/semaphore.c
@@ -24,8 +24,7 @@
#include "restart.h"
#include "queue.h"
-int __new_sem_init(sem_t *sem, int pshared, unsigned int value);
-int __new_sem_init(sem_t *sem, int pshared, unsigned int value)
+int sem_init(sem_t *sem, int pshared, unsigned int value)
{
if (value > SEM_VALUE_MAX) {
errno = EINVAL;
@@ -42,7 +41,7 @@ int __new_sem_init(sem_t *sem, int pshared, unsigned int value)
}
/* Function called by pthread_cancel to remove the thread from
- waiting inside __new_sem_wait. */
+ waiting inside sem_wait. */
static int new_sem_extricate_func(void *obj, pthread_descr th)
{
@@ -57,8 +56,7 @@ static int new_sem_extricate_func(void *obj, pthread_descr th)
return did_remove;
}
-int __new_sem_wait(sem_t * sem);
-int __new_sem_wait(sem_t * sem)
+int sem_wait(sem_t * sem)
{
volatile pthread_descr self = thread_self();
pthread_extricate_if extr;
@@ -120,8 +118,7 @@ int __new_sem_wait(sem_t * sem)
return 0;
}
-int __new_sem_trywait(sem_t * sem);
-int __new_sem_trywait(sem_t * sem)
+int sem_trywait(sem_t * sem)
{
int retval;
@@ -137,8 +134,7 @@ int __new_sem_trywait(sem_t * sem)
return retval;
}
-int __new_sem_post(sem_t * sem);
-int __new_sem_post(sem_t * sem)
+int sem_post(sem_t * sem)
{
pthread_descr self = thread_self();
pthread_descr th;
@@ -179,15 +175,13 @@ int __new_sem_post(sem_t * sem)
return 0;
}
-int __new_sem_getvalue(sem_t * sem, int * sval);
-int __new_sem_getvalue(sem_t * sem, int * sval)
+int sem_getvalue(sem_t * sem, int * sval)
{
*sval = sem->__sem_value;
return 0;
}
-int __new_sem_destroy(sem_t * sem);
-int __new_sem_destroy(sem_t * sem)
+int sem_destroy(sem_t * sem)
{
if (sem->__sem_waiting != NULL) {
__set_errno (EBUSY);
@@ -303,12 +297,3 @@ int sem_timedwait(sem_t *sem, const struct timespec *abstime)
/* We got the semaphore */
return 0;
}
-
-
-weak_alias (__new_sem_init, sem_init)
-weak_alias (__new_sem_wait, sem_wait)
-weak_alias (__new_sem_trywait, sem_trywait)
-weak_alias (__new_sem_post, sem_post)
-weak_alias (__new_sem_getvalue, sem_getvalue)
-weak_alias (__new_sem_destroy, sem_destroy)
-