From c090db7405b72ce6d0b726c0a39fb1c1aebab7ea Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 12 Sep 2017 08:09:16 +0200 Subject: posix: Implement self-contained POSIX semaphores For semaphore object pointer and object validation see POSIX_SEMAPHORE_VALIDATE_OBJECT(). Destruction or close of a busy semaphore returns an error status. The object is not flushed. POSIX semaphores are now available in all configurations and no longer depend on --enable-posix. Update #2514. Update #3116. --- testsuites/sptests/spthreadq01/init.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'testsuites/sptests/spthreadq01') diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c index 8f02e4d650..2b994e5d68 100644 --- a/testsuites/sptests/spthreadq01/init.c +++ b/testsuites/sptests/spthreadq01/init.c @@ -40,7 +40,6 @@ typedef struct { rtems_id mq; rtems_id br; #if defined(RTEMS_POSIX_API) - sem_t psem; pthread_mutex_t pmtx; pthread_cond_t pcv; pthread_rwlock_t prw; @@ -120,12 +119,6 @@ static void posix_worker(test_context *ctx) int eno; char buf[1]; - wake_up_master(ctx); - rtems_test_assert(get_wait_id(ctx) == ctx->psem); - - rv = sem_post(&ctx->psem); - rtems_test_assert(rv == 0); - eno = pthread_mutex_lock(&ctx->pmtx); rtems_test_assert(eno == 0); @@ -217,13 +210,9 @@ static void test_classic_init(test_context *ctx) static void test_posix_init(test_context *ctx) { #if defined(RTEMS_POSIX_API) - int rv; int eno; struct mq_attr attr; - rv = sem_init(&ctx->psem, 0, 0); - rtems_test_assert(rv == 0); - eno = pthread_mutex_init(&ctx->pmtx, NULL); rtems_test_assert(eno == 0); @@ -306,7 +295,6 @@ static void test_classic_obj(test_context *ctx) static void test_posix_obj(test_context *ctx) { #if defined(RTEMS_POSIX_API) - int rv; int eno; char buf[1]; unsigned prio; @@ -314,11 +302,6 @@ static void test_posix_obj(test_context *ctx) wait_for_worker(ctx); - rv = sem_wait(&ctx->psem); - rtems_test_assert(rv == 0); - - wait_for_worker(ctx); - eno = pthread_mutex_lock(&ctx->pmtx); rtems_test_assert(eno == 0); @@ -377,7 +360,6 @@ static rtems_task Init( #define CONFIGURE_MAXIMUM_BARRIERS 1 #if defined(RTEMS_POSIX_API) - #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 1 #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1 #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1 #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 1 -- cgit v1.2.3