diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/libc/port/threads/c11_thr.c | 6 | ||||
-rw-r--r-- | usr/src/man/man3c/thrd_equal.3c | 11 | ||||
-rw-r--r-- | usr/src/test/libc-tests/tests/c11_threads.c | 10 |
3 files changed, 14 insertions, 13 deletions
diff --git a/usr/src/lib/libc/port/threads/c11_thr.c b/usr/src/lib/libc/port/threads/c11_thr.c index 6a8c6d157e..a33fa12743 100644 --- a/usr/src/lib/libc/port/threads/c11_thr.c +++ b/usr/src/lib/libc/port/threads/c11_thr.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2016 Joyent, Inc. + * Copyright 2017 Joyent, Inc. */ #include <pthread.h> @@ -156,7 +156,7 @@ mtx_lock(mtx_t *mtx) int mtx_timedlock(mtx_t *_RESTRICT_KYWD mtx, - const struct timespec *_RESTRICT_KYWD abstime) + const struct timespec *_RESTRICT_KYWD abstime) { int ret; @@ -221,7 +221,7 @@ thrd_detach(thrd_t thr) int thrd_equal(thrd_t t1, thrd_t t2) { - return (!pthread_equal(t1, t2)); + return (pthread_equal(t1, t2)); } _NORETURN_KYWD void diff --git a/usr/src/man/man3c/thrd_equal.3c b/usr/src/man/man3c/thrd_equal.3c index 6c77a72138..86e5a22ef3 100644 --- a/usr/src/man/man3c/thrd_equal.3c +++ b/usr/src/man/man3c/thrd_equal.3c @@ -9,9 +9,9 @@ .\" http://www.illumos.org/license/CDDL. .\" .\" -.\" Copyright 2016 Joyent, Inc. +.\" Copyright 2017 Joyent, Inc. .\" -.Dd "Jan 11, 2015" +.Dd "Jan 19, 2017" .Dt THRD_EQUAL 3C .Os .Sh NAME @@ -36,13 +36,14 @@ and determines whether or not they refer to the same thread. The .Fn thrd_equal function returns -.Sy 0 +.Sy non-zero if .Fa thrd0 and .Fa thrd1 -refer to the same thread. Otherwise, a non-zero value is returned, -indicating that +refer to the same thread. Otherwise, +.Sy 0 +is returned, indicating that .Fa thrd0 and .Fa thrd1 diff --git a/usr/src/test/libc-tests/tests/c11_threads.c b/usr/src/test/libc-tests/tests/c11_threads.c index dffadcc2af..2f96bcbd89 100644 --- a/usr/src/test/libc-tests/tests/c11_threads.c +++ b/usr/src/test/libc-tests/tests/c11_threads.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2016 Joyent, Inc. + * Copyright 2017 Joyent, Inc. */ /* @@ -144,11 +144,11 @@ cthr_test_equal(void) self = thrd_current(); - VERIFY0(thrd_equal(self, self)); + VERIFY3S(thrd_equal(self, self), !=, 0); VERIFY3S(thrd_create(&other, cthr_test_sleep_thr, NULL), ==, thrd_success); - VERIFY3S(thrd_equal(self, other), !=, 0); - VERIFY3S(thrd_equal(other, other), ==, 0); + VERIFY3S(thrd_equal(self, other), ==, 0); + VERIFY3S(thrd_equal(other, other), !=, 0); VERIFY3S(thrd_detach(other), ==, thrd_success); } @@ -159,7 +159,7 @@ cthr_test_detach_err(void) self = thrd_current(); - VERIFY0(thrd_equal(self, self)); + VERIFY3S(thrd_equal(self, self), !=, 0); VERIFY3S(thrd_create(&other, cthr_test_sleep_thr, NULL), ==, thrd_success); VERIFY3S(thrd_detach(other), ==, thrd_success); |