You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/16 05:42:37 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 edited a comment on pull request #4129: libc/pthread: return EBUSY when barrier is in use

xiaoxiang781216 edited a comment on pull request #4129:
URL: https://github.com/apache/incubator-nuttx/pull/4129#issuecomment-881153955


   > my reading of the standard is that if an implementation detects the condition, it can report EBUSY.
   > it seems fine not to detect the condition.
   > IMO this is something which shouldn't be "fixed".
   > ltp is just broken or probably checking too specific implementation behavior.
   
   It isn't an implementation behaviour, it specify and recommand in standard.
   https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_barrier_destroy.html:
   ```
   If an implementation detects that the value specified by the barrier argument to pthread_barrier_destroy() or pthread_barrier_init() refers to a barrier that is in use (for example, in a pthread_barrier_wait() call) by another thread, or detects that the value specified by the barrier argument to pthread_barrier_init() refers to an already initialized barrier object, it is recommended that the function should fail and report an [EBUSY] error.
   ```
   
   > i think it's better not to "fix" this.
   
   And openbsd also return EBUSY too:
   https://github.com/openbsd/src/blob/2207c4325726fdc5c4bcd0011af0fdf7d3dab137/lib/librthread/rthread_barrier.c#L86-L89


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org