From b24cc7ca759c8ff6d82f4862f57a0483800e60be Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 6 Jun 2023 15:29:05 -0400 Subject: [PATCH] pthread: Use 1 for PTHREAD_BARRIER_SERIAL_THREAD. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pthread_barrier_wait can return errors, which on Haiku are negative and so -1 is an error condition, it should not be reused for a magic constant. This breaks ABI. However, until the recent fixes, barriers were so broken that I doubt any application was using them seriously (Mesa, for instance, has them disabled.) Change-Id: Ica23921de012a33e9e7aded816bb1347bd157b31 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6517 Reviewed-by: Jérôme Duval Reviewed-by: waddlesplash Tested-by: Commit checker robot Reviewed-by: X512 --- headers/posix/pthread.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/posix/pthread.h b/headers/posix/pthread.h index 1a833a47fe..106838ecb2 100644 --- a/headers/posix/pthread.h +++ b/headers/posix/pthread.h @@ -44,7 +44,8 @@ #define PTHREAD_ONCE_INIT { -1 } -#define PTHREAD_BARRIER_SERIAL_THREAD -1 +#define PTHREAD_BARRIER_SERIAL_THREAD 1 + #define PTHREAD_PRIO_NONE 0 #define PTHREAD_PRIO_INHERIT 1 #define PTHREAD_PRIO_PROTECT 2