summaryrefslogtreecommitdiffstats
path: root/lib/libc_r
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>2000-11-01 20:19:07 +0000
committerjdp <jdp@FreeBSD.org>2000-11-01 20:19:07 +0000
commitc7a7ecd8c550ba975d68eaf9ad5d7e25434b8684 (patch)
tree68a062e8b9cb8a69e9b64ff0473b30265af25106 /lib/libc_r
parentc4a9f49ba81d429e0feff56ed0c369ee75bab7b1 (diff)
downloadFreeBSD-src-c7a7ecd8c550ba975d68eaf9ad5d7e25434b8684.zip
FreeBSD-src-c7a7ecd8c550ba975d68eaf9ad5d7e25434b8684.tar.gz
At the beginning of pthread_mutex_lock(), call _thread_init() if
necessary. This works around a bug in old versions of libgcc_r.a which are statically linked into old executables.
Diffstat (limited to 'lib/libc_r')
-rw-r--r--lib/libc_r/uthread/uthread_mutex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_mutex.c b/lib/libc_r/uthread/uthread_mutex.c
index f7662c7..ec6c0f6 100644
--- a/lib/libc_r/uthread/uthread_mutex.c
+++ b/lib/libc_r/uthread/uthread_mutex.c
@@ -402,6 +402,9 @@ pthread_mutex_lock(pthread_mutex_t * mutex)
{
int ret = 0;
+ if (_thread_initial == NULL)
+ _thread_init();
+
if (mutex == NULL)
ret = EINVAL;
OpenPOWER on IntegriCloud