summaryrefslogtreecommitdiffstats
path: root/lib/libstdthreads
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committersjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit65145fa4c81da358fcbc3b650156dab705dfa34e (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /lib/libstdthreads
parent60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff)
parente6b664c390af88d4a87208bc042ce503da664c3b (diff)
downloadFreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip
FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz
Merge sync of head
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 544eeb0..8daee58 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 3b39ad7..37acbe0 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 6c9166d..f38fbae 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 f0ce55a..b0e36ef 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);
}
OpenPOWER on IntegriCloud