diff --git a/libs/libc/pthread/pthread_barrierinit.c b/libs/libc/pthread/pthread_barrierinit.c index 828caa79cfc..dc232ffa3fb 100644 --- a/libs/libc/pthread/pthread_barrierinit.c +++ b/libs/libc/pthread/pthread_barrierinit.c @@ -74,7 +74,6 @@ int pthread_barrier_init(FAR pthread_barrier_t *barrier, unsigned int count) { int ret = OK; - int semcount; if (!barrier || count == 0) { @@ -82,16 +81,8 @@ int pthread_barrier_init(FAR pthread_barrier_t *barrier, } else { - sem_getvalue(&barrier->sem, &semcount); - if (semcount == 0) - { - sem_init(&barrier->sem, 0, 0); - barrier->count = count; - } - else - { - ret = EBUSY; - } + sem_init(&barrier->sem, 0, 0); + barrier->count = count; } return ret;