1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

New pthread_barrier algorithm to fulfill barrier destruction requirements.

The previous barrier implementation did not fulfill the POSIX requirements
for when a barrier can be destroyed.  Specifically, it was possible that
threads that haven't noticed yet that their round is complete still access
the barrier's memory, and that those accesses can happen after the barrier
has been legally destroyed.
The new algorithm does not have this issue, and it avoids using a lock
internally.
This commit is contained in:
Torvald Riegel
2015-06-24 14:37:32 +02:00
parent a3e5b4feeb
commit b02840bacd
18 changed files with 417 additions and 762 deletions

View File

@ -24,15 +24,11 @@
int
pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, int pshared)
{
struct pthread_barrierattr *iattr;
int err = futex_supports_pshared (pshared);
if (err != 0)
return err;
iattr = (struct pthread_barrierattr *) attr;
iattr->pshared = pshared;
((struct pthread_barrierattr *) attr)->pshared = pshared;
return 0;
}