summaryrefslogtreecommitdiff
path: root/lib/libstdthreads
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit98e0ffaefb0f241cda3a72395d3be04192ae0d47 (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /lib/libstdthreads
parentb17ff922d4072ae132ece458f5b5d74a236880ac (diff)
parente81032ad243db32b8fd615b2d55ee94b9f6a5b6a (diff)
downloadsrc-test-98e0ffaefb0f241cda3a72395d3be04192ae0d47.tar.gz
src-test-98e0ffaefb0f241cda3a72395d3be04192ae0d47.zip
Merge sync of head
Notes
Notes: svn path=/projects/bmake/; revision=283595
Diffstat (limited to 'lib/libstdthreads')
-rw-r--r--lib/libstdthreads/Makefile3
-rw-r--r--lib/libstdthreads/Makefile.depend1
-rw-r--r--lib/libstdthreads/mtx.c2
-rw-r--r--lib/libstdthreads/thrd.c3
4 files changed, 4 insertions, 5 deletions
diff --git a/lib/libstdthreads/Makefile b/lib/libstdthreads/Makefile
index 544eeb0f12f13..8daee58b0e877 100644
--- a/lib/libstdthreads/Makefile
+++ b/lib/libstdthreads/Makefile
@@ -32,8 +32,7 @@ MLINKS= thrd_create.3 call_once.3 \
thrd_create.3 tss_get.3 \
thrd_create.3 tss_set.3
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
VERSION_DEF= ${.CURDIR}/../libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
diff --git a/lib/libstdthreads/Makefile.depend b/lib/libstdthreads/Makefile.depend
index 3b39ad7803612..37acbe0cd621b 100644
--- a/lib/libstdthreads/Makefile.depend
+++ b/lib/libstdthreads/Makefile.depend
@@ -3,7 +3,6 @@
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
diff --git a/lib/libstdthreads/mtx.c b/lib/libstdthreads/mtx.c
index 6c9166da71b4b..f38fbae5261eb 100644
--- a/lib/libstdthreads/mtx.c
+++ b/lib/libstdthreads/mtx.c
@@ -96,7 +96,7 @@ int
mtx_trylock(mtx_t *mtx)
{
- switch (pthread_mutex_lock(mtx)) {
+ switch (pthread_mutex_trylock(mtx)) {
case 0:
return (thrd_success);
case EBUSY:
diff --git a/lib/libstdthreads/thrd.c b/lib/libstdthreads/thrd.c
index f0ce55a567c46..b0e36ef618fbe 100644
--- a/lib/libstdthreads/thrd.c
+++ b/lib/libstdthreads/thrd.c
@@ -108,7 +108,8 @@ thrd_join(thrd_t thr, int *res)
if (pthread_join(thr, &value_ptr) != 0)
return (thrd_error);
- *res = (intptr_t)value_ptr;
+ if (res != NULL)
+ *res = (intptr_t)value_ptr;
return (thrd_success);
}