diff options
Diffstat (limited to 'lib/libstdthreads')
-rw-r--r-- | lib/libstdthreads/Makefile | 3 | ||||
-rw-r--r-- | lib/libstdthreads/Makefile.depend | 1 | ||||
-rw-r--r-- | lib/libstdthreads/mtx.c | 2 | ||||
-rw-r--r-- | lib/libstdthreads/thrd.c | 3 |
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); } |