pthread: Use 1 for PTHREAD_BARRIER_SERIAL_THREAD.

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 <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: X512 <danger_mail@list.ru>
This commit is contained in:
Augustin Cavalier 2023-06-06 15:29:05 -04:00 committed by waddlesplash
parent 4785ffe77c
commit b24cc7ca75

View File

@ -44,7 +44,8 @@
#define PTHREAD_ONCE_INIT { -1 } #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_NONE 0
#define PTHREAD_PRIO_INHERIT 1 #define PTHREAD_PRIO_INHERIT 1
#define PTHREAD_PRIO_PROTECT 2 #define PTHREAD_PRIO_PROTECT 2