summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/psxtests/psx05/init.c193
-rw-r--r--testsuites/psxtests/psx05/psx05.scn7
-rw-r--r--testsuites/psxtests/psx05/system.h3
-rw-r--r--testsuites/psxtests/psx09/system.h1
-rw-r--r--testsuites/psxtests/psx10/system.h1
-rw-r--r--testsuites/psxtests/psxaio01/system.h1
-rw-r--r--testsuites/psxtests/psxaio02/system.h1
-rw-r--r--testsuites/psxtests/psxaio03/system.h1
-rw-r--r--testsuites/psxtests/psxautoinit01/init.c23
-rw-r--r--testsuites/psxtests/psxautoinit01/psxautoinit01.scn7
-rw-r--r--testsuites/psxtests/psxautoinit02/init.c1
-rw-r--r--testsuites/psxtests/psxcleanup/system.h1
-rw-r--r--testsuites/psxtests/psxcond01/init.c1
-rw-r--r--testsuites/psxtests/psxconfig01/init.c13
-rw-r--r--testsuites/psxtests/psxkey07/init.c1
-rw-r--r--testsuites/psxtests/psxsignal06/init.c1
-rw-r--r--testsuites/psxtests/psxtimer01/system.h1
-rw-r--r--testsuites/psxtmtests/psxtmcond03/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmcond04/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmcond06/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmcond07/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmcond08/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmmutex01/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmmutex02/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmmutex03/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmmutex04/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmmutex05/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmmutex06/init.c1
-rw-r--r--testsuites/psxtmtests/psxtmmutex07/init.c1
-rw-r--r--testsuites/smptests/smppsxmutex01/init.c1
-rw-r--r--testsuites/sptests/spmutex01/init.c1
-rw-r--r--testsuites/sptests/spsysinit01/init.c15
-rw-r--r--testsuites/sptests/spthreadq01/init.c38
33 files changed, 194 insertions, 130 deletions
diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c
index e524d6f96f..4da2673857 100644
--- a/testsuites/psxtests/psx05/init.c
+++ b/testsuites/psxtests/psx05/init.c
@@ -239,6 +239,173 @@ static void test_errors_pthread_setschedprio( void )
rtems_test_assert( status == 0 );
}
+static void test_mutex_pshared_init(void)
+{
+ pthread_mutex_t mutex;
+ pthread_mutexattr_t attr;
+ int eno;
+
+ eno = pthread_mutexattr_init(&attr);
+ rtems_test_assert(eno == 0);
+
+ eno = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_PRIVATE);
+ rtems_test_assert(eno == 0);
+
+ eno = pthread_mutex_init(&mutex, &attr);
+ rtems_test_assert(eno == 0);
+
+ eno = pthread_mutex_destroy(&mutex);
+ rtems_test_assert(eno == 0);
+
+ eno = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
+ rtems_test_assert(eno == 0);
+
+ eno = pthread_mutex_init(&mutex, &attr);
+ rtems_test_assert(eno == 0);
+
+ eno = pthread_mutex_destroy(&mutex);
+ rtems_test_assert(eno == 0);
+
+ attr.process_shared = -1;
+
+ eno = pthread_mutex_init(&mutex, &attr);
+ rtems_test_assert(eno == EINVAL);
+
+ eno = pthread_mutexattr_destroy(&attr);
+ rtems_test_assert(eno == 0);
+}
+
+static void test_mutex_null( void )
+{
+ struct timespec to;
+ int eno;
+
+ eno = pthread_mutex_destroy( NULL );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_init( NULL, NULL );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_lock( NULL );
+ rtems_test_assert( eno == EINVAL );
+
+ to.tv_sec = 1;
+ to.tv_nsec = 1;
+ eno = pthread_mutex_timedlock( NULL, &to );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_trylock( NULL );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_unlock( NULL );
+ rtems_test_assert( eno == EINVAL );
+}
+
+static void test_mutex_not_initialized( void )
+{
+ pthread_mutex_t mutex;
+ struct timespec to;
+ int eno;
+
+ memset( &mutex, 0xff, sizeof( mutex ) );
+
+ eno = pthread_mutex_destroy( &mutex );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_lock( &mutex );
+ rtems_test_assert( eno == EINVAL );
+
+ to.tv_sec = 1;
+ to.tv_nsec = 1;
+ eno = pthread_mutex_timedlock( &mutex, &to );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_trylock( &mutex );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_unlock( &mutex );
+ rtems_test_assert( eno == EINVAL );
+}
+
+static void test_mutex_invalid_copy( void )
+{
+ pthread_mutex_t mutex;
+ pthread_mutex_t mutex2;
+ struct timespec to;
+ int eno;
+
+ eno = pthread_mutex_init( &mutex, NULL );
+ rtems_test_assert( eno == 0 );
+
+ memcpy( &mutex2, &mutex, sizeof( mutex2 ) );
+
+ eno = pthread_mutex_destroy( &mutex2 );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_lock( &mutex2 );
+ rtems_test_assert( eno == EINVAL );
+
+ to.tv_sec = 1;
+ to.tv_nsec = 1;
+ eno = pthread_mutex_timedlock( &mutex2, &to );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_trylock( &mutex2 );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_unlock( &mutex2 );
+ rtems_test_assert( eno == EINVAL );
+
+ eno = pthread_mutex_destroy( &mutex );
+ rtems_test_assert( eno == 0 );
+}
+
+static void test_mutex_auto_initialization( void )
+{
+ struct timespec to;
+ int eno;
+
+ {
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+ eno = pthread_mutex_destroy( &mutex );
+ rtems_test_assert( eno == 0 );
+
+ eno = pthread_mutex_destroy( &mutex );
+ rtems_test_assert( eno == EINVAL );
+ }
+
+ {
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+ eno = pthread_mutex_lock( &mutex );
+ rtems_test_assert( eno == 0 );
+ }
+
+ {
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+ to.tv_sec = 1;
+ to.tv_nsec = 1;
+ eno = pthread_mutex_timedlock( &mutex, &to );
+ rtems_test_assert( eno == 0 );
+ }
+
+ {
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+ eno = pthread_mutex_trylock( &mutex );
+ rtems_test_assert( eno == 0 );
+ }
+
+ {
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+ eno = pthread_mutex_unlock( &mutex );
+ rtems_test_assert( eno == EPERM );
+ }
+}
+
void *POSIX_Init(
void *argument
)
@@ -255,11 +422,15 @@ void *POSIX_Init(
int old_ceiling;
int priority;
- rtems_test_assert( MUTEX_BAD_ID != PTHREAD_MUTEX_INITIALIZER );
- Mutex_bad_id = MUTEX_BAD_ID;
+ Mutex_bad_id = NULL;
TEST_BEGIN();
+ test_mutex_pshared_init();
+ test_mutex_null();
+ test_mutex_not_initialized();
+ test_mutex_invalid_copy();
+ test_mutex_auto_initialization();
test_get_priority();
test_set_priority();
test_errors_pthread_setschedprio();
@@ -504,7 +675,7 @@ void *POSIX_Init(
#endif
puts( "Init: pthread_mutex_trylock - EINVAL (illegal ID)" );
- status = pthread_mutex_trylock( &Mutex_bad_id );
+ status = pthread_mutex_trylock( Mutex_bad_id );
if ( status != EINVAL )
printf( "status = %d\n", status );
rtems_test_assert( status == EINVAL );
@@ -546,7 +717,7 @@ void *POSIX_Init(
/* switch to task 1 */
puts( "Init: pthread_mutex_unlock - EINVAL (invalid id)" );
- status = pthread_mutex_unlock( &Mutex_bad_id );
+ status = pthread_mutex_unlock( Mutex_bad_id );
if ( status != EINVAL )
printf( "status = %d\n", status );
rtems_test_assert( status == EINVAL );
@@ -593,20 +764,24 @@ void *POSIX_Init(
printf( "status = %d\n", status );
rtems_test_assert( !status );
- puts( "Init: pthread_mutex_init - EAGAIN (too many)" );
+ puts( "Init: pthread_mutex_init - SUCCESSFUL" );
status = pthread_mutex_init( &Mutex3_id, &attr );
- rtems_test_assert( status == EAGAIN );
+ rtems_test_assert( !status );
puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" );
status = pthread_mutexattr_destroy( &attr );
rtems_test_assert( !status );
puts( "Init: pthread_mutex_destroy - SUCCESSFUL" );
+ status = pthread_mutex_destroy( &Mutex3_id );
+ rtems_test_assert( !status );
+
+ puts( "Init: pthread_mutex_destroy - SUCCESSFUL" );
status = pthread_mutex_destroy( &Mutex2_id );
rtems_test_assert( !status );
puts( "Init: pthread_mutex_destroy - EINVAL (invalid id)" );
- status = pthread_mutex_destroy( &Mutex_bad_id );
+ status = pthread_mutex_destroy( Mutex_bad_id );
rtems_test_assert( status == EINVAL );
/* destroy a busy mutex */
@@ -713,7 +888,7 @@ void *POSIX_Init(
rtems_test_assert( !status );
puts( "Init: pthread_mutex_getprioceiling - EINVAL (invalid id)" );
- status = pthread_mutex_getprioceiling( &Mutex_bad_id, &ceiling );
+ status = pthread_mutex_getprioceiling( Mutex_bad_id, &ceiling );
rtems_test_assert( status == EINVAL );
puts( "Init: pthread_mutex_getprioceiling - EINVAL (NULL ceiling)" );
@@ -725,7 +900,7 @@ void *POSIX_Init(
printf( "Init: pthread_mutex_getprioceiling - %d\n", ceiling );
puts( "Init: pthread_mutex_setprioceiling - EINVAL (invalid id)" );
- status = pthread_mutex_setprioceiling( &Mutex_bad_id, 200, &old_ceiling );
+ status = pthread_mutex_setprioceiling( Mutex_bad_id, 200, &old_ceiling );
rtems_test_assert( status == EINVAL );
puts( "Init: pthread_mutex_setprioceiling - EINVAL (illegal priority)" );
diff --git a/testsuites/psxtests/psx05/psx05.scn b/testsuites/psxtests/psx05/psx05.scn
index 0315eee562..700f3bfb4f 100644
--- a/testsuites/psxtests/psx05/psx05.scn
+++ b/testsuites/psxtests/psx05/psx05.scn
@@ -3,7 +3,7 @@ Init's ID is 0x0b010001
Init: pthread_mutexattr_init - EINVAL (NULL attr)
Init: pthread_mutexattr_init - SUCCESSFUL
Init: mutex protocol is (0) -- PTHREAD_PRIO_NONE
-Init: mutex priority ceiling is 254
+Init: mutex priority ceiling is 2147483647
Init: mutex process shared is (0) -- PTHREAD_PROCESS_PRIVATE
Init: pthread_mutexattr_destroy - SUCCESSFUL
Init: pthread_mutexattr_destroy - EINVAL (NULL attr)
@@ -67,9 +67,10 @@ Init: pthread_mutex_timedlock - time out in the past
Init: pthread_mutex_timedlock - EAGAIN (timeout)
Init: pthread_mutex_init - SUCCESSFUL
-Init: pthread_mutex_init - EAGAIN (too many)
+Init: pthread_mutex_init - SUCCESSFUL
Init: pthread_mutexattr_destroy - SUCCESSFUL
Init: pthread_mutex_destroy - SUCCESSFUL
+Init: pthread_mutex_destroy - SUCCESSFUL
Init: pthread_mutex_destroy - EINVAL (invalid id)
Init: pthread_mutexattr_init - SUCCESSFUL
@@ -113,8 +114,6 @@ Task 3: pthread_mutex_lock unavailable (inherit case)
Init: pthread_mutex_unlock - SUCCESSFUL
Task 3: mutex acquired
Task 3: unlock Mutex 2
-Task 3: pthread_getschedparam priority = 199
-Task 3: exit
Init: pthread_mutex_getprioceiling- ceiling = 200
Init: pthread_setschedparam - set Init priority to highest
Init: pthread_mutex_lock - EINVAL (priority ceiling violation)
diff --git a/testsuites/psxtests/psx05/system.h b/testsuites/psxtests/psx05/system.h
index a3615d49c3..a4d128d6f6 100644
--- a/testsuites/psxtests/psx05/system.h
+++ b/testsuites/psxtests/psx05/system.h
@@ -39,7 +39,6 @@ void *Task_3(
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_POSIX_THREADS 4
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
@@ -62,6 +61,6 @@ TEST_EXTERN pthread_t Task3_id;
TEST_EXTERN pthread_mutex_t Mutex_id;
TEST_EXTERN pthread_mutex_t Mutex2_id;
TEST_EXTERN pthread_mutex_t Mutex3_id;
-TEST_EXTERN pthread_mutex_t Mutex_bad_id;
+TEST_EXTERN pthread_mutex_t *Mutex_bad_id;
/* end of include file */
diff --git a/testsuites/psxtests/psx09/system.h b/testsuites/psxtests/psx09/system.h
index a5aabeb82d..2a86aa25fd 100644
--- a/testsuites/psxtests/psx09/system.h
+++ b/testsuites/psxtests/psx09/system.h
@@ -36,7 +36,6 @@ void *Task_2(
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
diff --git a/testsuites/psxtests/psx10/system.h b/testsuites/psxtests/psx10/system.h
index ee7e9c4dcf..93ed9ff075 100644
--- a/testsuites/psxtests/psx10/system.h
+++ b/testsuites/psxtests/psx10/system.h
@@ -41,7 +41,6 @@ void *Task_3(
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_POSIX_THREADS 4
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
diff --git a/testsuites/psxtests/psxaio01/system.h b/testsuites/psxtests/psxaio01/system.h
index e17f7cab6d..1bedd7328a 100644
--- a/testsuites/psxtests/psxaio01/system.h
+++ b/testsuites/psxtests/psxaio01/system.h
@@ -28,7 +28,6 @@ void *POSIX_Init (void *argument);
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10
#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
diff --git a/testsuites/psxtests/psxaio02/system.h b/testsuites/psxtests/psxaio02/system.h
index e3e1333964..4f2f08a7b1 100644
--- a/testsuites/psxtests/psxaio02/system.h
+++ b/testsuites/psxtests/psxaio02/system.h
@@ -28,7 +28,6 @@ void *POSIX_Init (void *argument);
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10
#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
diff --git a/testsuites/psxtests/psxaio03/system.h b/testsuites/psxtests/psxaio03/system.h
index c809bc7045..68bf3046eb 100644
--- a/testsuites/psxtests/psxaio03/system.h
+++ b/testsuites/psxtests/psxaio03/system.h
@@ -29,7 +29,6 @@ void *POSIX_Init (void *argument);
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_POSIX_THREADS 30
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 30
#define CONFIGURE_MAXIMUM_POSIX_KEYS 30
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
diff --git a/testsuites/psxtests/psxautoinit01/init.c b/testsuites/psxtests/psxautoinit01/init.c
index f22cb1dc9d..9001de2306 100644
--- a/testsuites/psxtests/psxautoinit01/init.c
+++ b/testsuites/psxtests/psxautoinit01/init.c
@@ -25,23 +25,17 @@ void *POSIX_Init(
)
{
int sc;
- pthread_mutex_t mutex1;
- pthread_mutex_t mutex2;
+ pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER;
int prioceiling;
TEST_BEGIN();
/* path using mutex get with interrupts disabled */
- mutex1 = PTHREAD_MUTEX_INITIALIZER;
- mutex2 = PTHREAD_MUTEX_INITIALIZER;
puts( "Init - pthread_mutex_lock - auto initialize - OK" );
sc = pthread_mutex_lock( &mutex1 );
fatal_posix_service_status( sc, 0, "mutex lock OK" );
- puts( "Init - pthread_mutex_lock - auto initialize - EINVAL" );
- sc = pthread_mutex_lock( &mutex2 );
- fatal_posix_service_status( sc, EINVAL, "mutex lock EINVAL" );
-
puts( "Init - pthread_mutex_unlock - OK" );
sc = pthread_mutex_unlock( &mutex1 );
fatal_posix_service_status( sc, 0, "mutex unlock OK" );
@@ -51,22 +45,14 @@ void *POSIX_Init(
fatal_posix_service_status( sc, 0, "mutex destroy OK" );
/* path using mutex get with dispatching disabled */
- mutex1 = PTHREAD_MUTEX_INITIALIZER;
- mutex2 = PTHREAD_MUTEX_INITIALIZER;
puts( "Init - pthread_mutex_getprioceiling - auto initialize - OK" );
prioceiling = 1;
- sc = pthread_mutex_getprioceiling( &mutex1, &prioceiling );
+ sc = pthread_mutex_getprioceiling( &mutex2, &prioceiling );
fatal_posix_service_status( sc, 0, "mutex getprioceiling OK" );
rtems_test_assert( prioceiling == 0 );
- puts( "Init - pthread_mutex_getprioceiling - auto initialize - EINVAL" );
- prioceiling = 1;
- sc = pthread_mutex_getprioceiling( &mutex2, &prioceiling );
- fatal_posix_service_status( sc, EINVAL, "mutex getprioceiling EINVAL" );
- rtems_test_assert( prioceiling == 1 );
-
puts( "Init - pthread_mutex_destroy - OK" );
- sc = pthread_mutex_destroy( &mutex1 );
+ sc = pthread_mutex_destroy( &mutex2 );
fatal_posix_service_status( sc, 0, "mutex destroy OK" );
TEST_END();
@@ -81,7 +67,6 @@ void *POSIX_Init(
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
diff --git a/testsuites/psxtests/psxautoinit01/psxautoinit01.scn b/testsuites/psxtests/psxautoinit01/psxautoinit01.scn
index 9293acc626..3638ac4e94 100644
--- a/testsuites/psxtests/psxautoinit01/psxautoinit01.scn
+++ b/testsuites/psxtests/psxautoinit01/psxautoinit01.scn
@@ -1,10 +1,7 @@
-*** POSIX TEST -- AUTOMATIC INITIALIZAITON 01 ***
+*** BEGIN OF TEST PSXAUTOINIT 1 ***
Init - pthread_mutex_lock - auto initialize - OK
-Init - pthread_mutex_lock - auto initialize - EINVAL
Init - pthread_mutex_unlock - OK
Init - pthread_mutex_destroy - OK
Init - pthread_mutex_getprioceiling - auto initialize - OK
-Init - pthread_mutex_getprioceiling - auto initialize - EINVAL
Init - pthread_mutex_destroy - OK
-*** END OF POSIX TEST AUTOMATIC INITIALIZATION 01 ***
-
+*** END OF TEST PSXAUTOINIT 1 ***
diff --git a/testsuites/psxtests/psxautoinit02/init.c b/testsuites/psxtests/psxautoinit02/init.c
index bba4e24ea4..5d652f7467 100644
--- a/testsuites/psxtests/psxautoinit02/init.c
+++ b/testsuites/psxtests/psxautoinit02/init.c
@@ -101,7 +101,6 @@ void *POSIX_Init(
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
diff --git a/testsuites/psxtests/psxcleanup/system.h b/testsuites/psxtests/psxcleanup/system.h
index 2111c9fab5..04ea60394a 100644
--- a/testsuites/psxtests/psxcleanup/system.h
+++ b/testsuites/psxtests/psxcleanup/system.h
@@ -44,7 +44,6 @@ void *task_c(
#define CONFIGURE_MAXIMUM_POSIX_THREADS 4
#define CONFIGURE_MAXIMUM_POSIX_TIMERS 4
#define CONFIGURE_MAXIMUM_TIMERS 4
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#include <rtems/confdefs.h>
diff --git a/testsuites/psxtests/psxcond01/init.c b/testsuites/psxtests/psxcond01/init.c
index 37fd4fdbb4..574769659a 100644
--- a/testsuites/psxtests/psxcond01/init.c
+++ b/testsuites/psxtests/psxcond01/init.c
@@ -95,7 +95,6 @@ void *POSIX_Init(
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
diff --git a/testsuites/psxtests/psxconfig01/init.c b/testsuites/psxtests/psxconfig01/init.c
index f62c2d5508..a1dc4c618f 100644
--- a/testsuites/psxtests/psxconfig01/init.c
+++ b/testsuites/psxtests/psxconfig01/init.c
@@ -61,7 +61,6 @@ const char rtems_test_name[] = "PSXCONFIG 1";
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 17
#define POSIX_MQ_COUNT 5
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 19
#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 7
#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 41
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
@@ -447,18 +446,6 @@ static rtems_task Init(rtems_task_argument argument)
);
#endif
-#ifdef CONFIGURE_MAXIMUM_POSIX_MUTEXES
- for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_MUTEXES; ++i) {
- pthread_mutex_t mutex;
- eno = pthread_mutex_init(&mutex, NULL);
- rtems_test_assert(eno == 0);
- }
- rtems_resource_snapshot_take(&snapshot);
- rtems_test_assert(
- snapshot.posix_api.active_mutexes == CONFIGURE_MAXIMUM_POSIX_MUTEXES
- );
-#endif
-
#ifdef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; ++i) {
int oflag = O_RDWR | O_CREAT | O_EXCL;
diff --git a/testsuites/psxtests/psxkey07/init.c b/testsuites/psxtests/psxkey07/init.c
index 3790ea36aa..91cc7ea4ea 100644
--- a/testsuites/psxtests/psxkey07/init.c
+++ b/testsuites/psxtests/psxkey07/init.c
@@ -196,7 +196,6 @@ rtems_task Init(rtems_task_argument argument)
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited(10)
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_MAXIMUM_POSIX_KEYS 1
#define CONFIGURE_UNIFIED_WORK_AREAS
diff --git a/testsuites/psxtests/psxsignal06/init.c b/testsuites/psxtests/psxsignal06/init.c
index 0177a2acea..cb34bb6bc8 100644
--- a/testsuites/psxtests/psxsignal06/init.c
+++ b/testsuites/psxtests/psxsignal06/init.c
@@ -126,7 +126,6 @@ void *POSIX_Init(void *argument)
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
diff --git a/testsuites/psxtests/psxtimer01/system.h b/testsuites/psxtests/psxtimer01/system.h
index 3fb71cadae..3ca39e41bc 100644
--- a/testsuites/psxtests/psxtimer01/system.h
+++ b/testsuites/psxtests/psxtimer01/system.h
@@ -44,7 +44,6 @@ void *task_c(
#define CONFIGURE_MAXIMUM_POSIX_THREADS 5
#define CONFIGURE_MAXIMUM_POSIX_TIMERS 5
#define CONFIGURE_MAXIMUM_TIMERS 4
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#include <rtems/confdefs.h>
diff --git a/testsuites/psxtmtests/psxtmcond03/init.c b/testsuites/psxtmtests/psxtmcond03/init.c
index 782782a23d..4a829bd55e 100644
--- a/testsuites/psxtmtests/psxtmcond03/init.c
+++ b/testsuites/psxtmtests/psxtmcond03/init.c
@@ -106,7 +106,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmcond04/init.c b/testsuites/psxtmtests/psxtmcond04/init.c
index 9ed2ae61b4..1a40f23e53 100644
--- a/testsuites/psxtmtests/psxtmcond04/init.c
+++ b/testsuites/psxtmtests/psxtmcond04/init.c
@@ -99,7 +99,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmcond06/init.c b/testsuites/psxtmtests/psxtmcond06/init.c
index 630641d31d..ec87ccd45c 100644
--- a/testsuites/psxtmtests/psxtmcond06/init.c
+++ b/testsuites/psxtmtests/psxtmcond06/init.c
@@ -123,7 +123,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 + N
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmcond07/init.c b/testsuites/psxtmtests/psxtmcond07/init.c
index 20952e5542..218fccccd4 100644
--- a/testsuites/psxtmtests/psxtmcond07/init.c
+++ b/testsuites/psxtmtests/psxtmcond07/init.c
@@ -119,7 +119,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 + N
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmcond08/init.c b/testsuites/psxtmtests/psxtmcond08/init.c
index 6f11b9e619..377b09948d 100644
--- a/testsuites/psxtmtests/psxtmcond08/init.c
+++ b/testsuites/psxtmtests/psxtmcond08/init.c
@@ -170,7 +170,6 @@ void *POSIX_Init(
#define CONFIGURE_MAXIMUM_POSIX_THREADS OPERATION_COUNT + 2
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmmutex01/init.c b/testsuites/psxtmtests/psxtmmutex01/init.c
index c8f6054c65..7a020f917d 100644
--- a/testsuites/psxtmtests/psxtmmutex01/init.c
+++ b/testsuites/psxtmtests/psxtmmutex01/init.c
@@ -83,7 +83,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmmutex02/init.c b/testsuites/psxtmtests/psxtmmutex02/init.c
index 3ae6276dbc..b71e21f35f 100644
--- a/testsuites/psxtmtests/psxtmmutex02/init.c
+++ b/testsuites/psxtmtests/psxtmmutex02/init.c
@@ -124,7 +124,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS OPERATION_COUNT + 2
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmmutex03/init.c b/testsuites/psxtmtests/psxtmmutex03/init.c
index bad1f278ea..6a29230520 100644
--- a/testsuites/psxtmtests/psxtmmutex03/init.c
+++ b/testsuites/psxtmtests/psxtmmutex03/init.c
@@ -173,7 +173,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmmutex04/init.c b/testsuites/psxtmtests/psxtmmutex04/init.c
index e4227638ac..6513c59223 100644
--- a/testsuites/psxtmtests/psxtmmutex04/init.c
+++ b/testsuites/psxtmtests/psxtmmutex04/init.c
@@ -124,7 +124,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS OPERATION_COUNT + 2
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmmutex05/init.c b/testsuites/psxtmtests/psxtmmutex05/init.c
index 712b5cc56d..d274fc5257 100644
--- a/testsuites/psxtmtests/psxtmmutex05/init.c
+++ b/testsuites/psxtmtests/psxtmmutex05/init.c
@@ -96,7 +96,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmmutex06/init.c b/testsuites/psxtmtests/psxtmmutex06/init.c
index 2e8b82de80..c2bd0011c7 100644
--- a/testsuites/psxtmtests/psxtmmutex06/init.c
+++ b/testsuites/psxtmtests/psxtmmutex06/init.c
@@ -150,7 +150,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS OPERATION_COUNT + 2
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/psxtmtests/psxtmmutex07/init.c b/testsuites/psxtmtests/psxtmmutex07/init.c
index 299f87d714..9f087e5465 100644
--- a/testsuites/psxtmtests/psxtmmutex07/init.c
+++ b/testsuites/psxtmtests/psxtmmutex07/init.c
@@ -97,7 +97,6 @@ void *POSIX_Init(
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/smptests/smppsxmutex01/init.c b/testsuites/smptests/smppsxmutex01/init.c
index 3ed22b107e..aeed75c6d1 100644
--- a/testsuites/smptests/smppsxmutex01/init.c
+++ b/testsuites/smptests/smppsxmutex01/init.c
@@ -157,7 +157,6 @@ static void *POSIX_Init(void *arg)
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2
#define CONFIGURE_MAXIMUM_PROCESSORS 2
diff --git a/testsuites/sptests/spmutex01/init.c b/testsuites/sptests/spmutex01/init.c
index 0c216a3901..b9d4a05f73 100644
--- a/testsuites/sptests/spmutex01/init.c
+++ b/testsuites/sptests/spmutex01/init.c
@@ -713,7 +713,6 @@ static void fatal_extension(
#define CONFIGURE_MAXIMUM_SEMAPHORES 3
#ifdef RTEMS_POSIX_API
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#endif
#define CONFIGURE_INITIAL_EXTENSIONS \
diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c
index 902d6abe03..f6fa1ddaf4 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -103,8 +103,6 @@ typedef enum {
POSIX_SIGNALS_POST,
POSIX_THREADS_PRE,
POSIX_THREADS_POST,
- POSIX_MUTEX_PRE,
- POSIX_MUTEX_POST,
POSIX_MESSAGE_QUEUE_PRE,
POSIX_MESSAGE_QUEUE_POST,
POSIX_SEMAPHORE_PRE,
@@ -438,18 +436,6 @@ LAST(RTEMS_SYSINIT_POSIX_THREADS)
next_step(POSIX_THREADS_POST);
}
-FIRST(RTEMS_SYSINIT_POSIX_MUTEX)
-{
- assert(_POSIX_Mutex_Information.maximum == 0);
- next_step(POSIX_MUTEX_PRE);
-}
-
-LAST(RTEMS_SYSINIT_POSIX_MUTEX)
-{
- assert(_POSIX_Mutex_Information.maximum != 0);
- next_step(POSIX_MUTEX_POST);
-}
-
FIRST(RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE)
{
assert(_POSIX_Message_queue_Information.maximum == 0);
@@ -716,7 +702,6 @@ static void *POSIX_Init(void *arg)
#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 1
-#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 1
diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c
index 473db6d05a..5ec03fdddc 100644
--- a/testsuites/sptests/spthreadq01/init.c
+++ b/testsuites/sptests/spthreadq01/init.c
@@ -40,8 +40,6 @@ typedef struct {
rtems_id mq;
rtems_id br;
#if defined(RTEMS_POSIX_API)
- pthread_mutex_t pmtx;
- pthread_cond_t pcv;
mqd_t pmq;
#endif
} test_context;
@@ -118,24 +116,6 @@ static void posix_worker(test_context *ctx)
int eno;
char buf[1];
- eno = pthread_mutex_lock(&ctx->pmtx);
- rtems_test_assert(eno == 0);
-
- wake_up_master(ctx);
- rtems_test_assert(get_wait_id(ctx) == ctx->pmtx);
-
- eno = pthread_mutex_unlock(&ctx->pmtx);
- rtems_test_assert(eno == 0);
-
- eno = pthread_mutex_lock(&ctx->pmtx);
- rtems_test_assert(eno == 0);
-
- eno = pthread_cond_signal(&ctx->pcv);
- rtems_test_assert(eno == 0);
-
- eno = pthread_mutex_unlock(&ctx->pmtx);
- rtems_test_assert(eno == 0);
-
wake_up_master(ctx);
rtems_test_assert(get_wait_id(ctx) == ctx->pmq);
@@ -201,12 +181,6 @@ static void test_posix_init(test_context *ctx)
int eno;
struct mq_attr attr;
- eno = pthread_mutex_init(&ctx->pmtx, NULL);
- rtems_test_assert(eno == 0);
-
- eno = pthread_cond_init(&ctx->pcv, NULL);
- rtems_test_assert(eno == 0);
-
memset(&attr, 0, sizeof(attr));
attr.mq_maxmsg = 1;
attr.mq_msgsize = sizeof(char);
@@ -287,17 +261,6 @@ static void test_posix_obj(test_context *ctx)
wait_for_worker(ctx);
- eno = pthread_mutex_lock(&ctx->pmtx);
- rtems_test_assert(eno == 0);
-
- eno = pthread_cond_wait(&ctx->pcv, &ctx->pmtx);
- rtems_test_assert(eno == 0);
-
- eno = pthread_mutex_unlock(&ctx->pmtx);
- rtems_test_assert(eno == 0);
-
- wait_for_worker(ctx);
-
buf[0] = 'y';
prio = 1;
n = mq_receive(ctx->pmq, &buf[0], sizeof(buf), &prio);
@@ -340,7 +303,6 @@ static rtems_task Init(
#define CONFIGURE_MAXIMUM_BARRIERS 1
#if defined(RTEMS_POSIX_API)
- #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 1
#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
(2 * CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(1, 1))