diff --git a/testing/ostest/barrier.c b/testing/ostest/barrier.c index a304448c4..8fc9768d0 100644 --- a/testing/ostest/barrier.c +++ b/testing/ostest/barrier.c @@ -107,6 +107,8 @@ void barrier_test(void) printf("barrier_test: Initializing barrier\n"); + /* Create the barrier */ + status = pthread_barrierattr_init(&barrierattr); if (status != OK) { @@ -122,10 +124,6 @@ void barrier_test(void) status); } - /* Create the barrier */ - - pthread_barrierattr_init(&barrierattr); - /* Start CONFIG_TESTING_OSTEST_NBARRIER_THREADS thread instances */ status = pthread_attr_init(&attr);