diff options
Diffstat (limited to 'libc/misc/pthread')
-rw-r--r-- | libc/misc/pthread/Makefile.in | 4 | ||||
-rw-r--r-- | libc/misc/pthread/tsd.c | 10 | ||||
-rw-r--r-- | libc/misc/pthread/unlock.c | 27 | ||||
-rw-r--r-- | libc/misc/pthread/weaks.c | 6 |
4 files changed, 13 insertions, 34 deletions
diff --git a/libc/misc/pthread/Makefile.in b/libc/misc/pthread/Makefile.in index 36161238d..69cdf104a 100644 --- a/libc/misc/pthread/Makefile.in +++ b/libc/misc/pthread/Makefile.in @@ -10,8 +10,8 @@ subdirs += libc/misc/pthread MISC_PTHREAD_DIR := $(top_srcdir)libc/misc/pthread MISC_PTHREAD_OUT := $(top_builddir)libc/misc/pthread -libc-$(UCLIBC_HAS_THREADS) += $(MISC_PTHREAD_OUT)/unlock.o -libc-$(UCLIBC_HAS_THREADS) += $(MISC_PTHREAD_OUT)/weaks.o +libc-shared-$(UCLIBC_HAS_TLS) += $(MISC_PTHREAD_OUT)/tsd.os +libc-static-$(UCLIBC_HAS_THREADS) += $(MISC_PTHREAD_OUT)/weaks.o objclean-y += CLEAN_libc/misc/pthread diff --git a/libc/misc/pthread/tsd.c b/libc/misc/pthread/tsd.c new file mode 100644 index 000000000..835ee22ce --- /dev/null +++ b/libc/misc/pthread/tsd.c @@ -0,0 +1,10 @@ +/* libpthread sets _dl_error_catch_tsd to point to this function. + We define it here instead of in libpthread so t here instead of in libpthread so that it doesn't + need to have a TLS segment of its own just for this one pointer. */ + +void ** __attribute__ ((const)) +__libc_dl_error_tsd (void) +{ + static __thread void *data __attribute__ ((tls_model ("initial-exec"))); + return &data; +} diff --git a/libc/misc/pthread/unlock.c b/libc/misc/pthread/unlock.c deleted file mode 100644 index 04de0df58..000000000 --- a/libc/misc/pthread/unlock.c +++ /dev/null @@ -1,27 +0,0 @@ -/* The weak pthread functions for Linux. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <bits/uClibc_mutex.h> - -void attribute_hidden __uclibc_mutex_unlock (void *arg) -{ - pthread_mutex_t *__mutex = (pthread_mutex_t *)arg; - __pthread_mutex_unlock(__mutex); -} diff --git a/libc/misc/pthread/weaks.c b/libc/misc/pthread/weaks.c index 580c3eb07..fb1d85fd7 100644 --- a/libc/misc/pthread/weaks.c +++ b/libc/misc/pthread/weaks.c @@ -37,8 +37,4 @@ weak_alias (__pthread_return_0, __pthread_mutex_trylock) weak_alias (__pthread_return_0, __pthread_mutex_unlock) weak_alias (__pthread_return_void, _pthread_cleanup_push_defer) weak_alias (__pthread_return_void, _pthread_cleanup_pop_restore) -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ -weak_alias (__pthread_return_0, __pthread_mutexattr_init) -weak_alias (__pthread_return_0, __pthread_mutexattr_destroy) -weak_alias (__pthread_return_0, __pthread_mutexattr_settype) -#endif + |