Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong behavior in pthread_barrier_wait() #9953

Closed
ceolin opened this issue Sep 13, 2018 · 3 comments
Closed

wrong behavior in pthread_barrier_wait() #9953

ceolin opened this issue Sep 13, 2018 · 3 comments
Labels
area: POSIX POSIX API Library bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Milestone

Comments

@ceolin
Copy link
Member

ceolin commented Sep 13, 2018

This function does not have the behaviour defined in IEEE Std 1003.1.
It should return PTHREAD_BARRIER_SERIAL_THREAD constant for an arbitrary thread and 0 for the others synchronized threads.

@ceolin ceolin added the bug The issue is a bug, or the PR is fixing a bug label Sep 13, 2018
@ceolin ceolin added this to the v1.14.0 milestone Sep 13, 2018
@nashif
Copy link
Member

nashif commented Sep 13, 2018

@nniranjhana fyi

@nashif nashif added priority: medium Medium impact/importance bug area: POSIX POSIX API Library labels Sep 13, 2018
andyross pushed a commit to andyross/zephyr that referenced this issue Sep 13, 2018
The return value from this function is supposed to return
"PTHREAD_BARRIER_SERIAL_WAIT" from exactly one of the calling threads,
otherwise zero or an error code.

Fixes zephyrproject-rtos#9953

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
@andyross
Copy link
Contributor

Pushed a quick fix for the bug (which was mine). Probably wants a test to check this added somewhere too.

@nniranjhana
Copy link

@andyross I will add this check to the test and push as part of my PR for #9912

@ghost ghost assigned ghost and unassigned andyross Feb 26, 2019
nashif pushed a commit that referenced this issue Mar 2, 2019
Exactly one caller of pthread_barrier_wait() should receive a return
value of PTHREAD_BARRIER_SERIAL_WAIT; all others should receive zero
(or an error code). Added a test to match.

Fixes: #9953

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants