forked from Imagelibrary/rtems
2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxtmmutex05/init.c: Fix test. Pattern was wrong.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* psxtmmutex05/init.c: Fix test. Pattern was wrong.
|
||||
|
||||
2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* Makefile.am, configure.ac: Add benchmark of pthread_mutex_unlock
|
||||
|
||||
@@ -23,22 +23,13 @@
|
||||
|
||||
pthread_mutex_t MutexId;
|
||||
|
||||
void *Blockers(
|
||||
void *Blocker(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int status;
|
||||
|
||||
/*
|
||||
* Now we have finished the thread startup overhead,
|
||||
* so let other threads run. When we return, we can
|
||||
* finish the benchmark.
|
||||
*/
|
||||
sched_yield();
|
||||
/* let other threads run */
|
||||
|
||||
status = pthread_mutex_lock( &MutexId );
|
||||
rtems_test_assert( status == 0 );
|
||||
(void) pthread_mutex_lock( &MutexId );
|
||||
/* should never return */
|
||||
rtems_test_assert( FALSE );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -47,17 +38,14 @@ void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
int i;
|
||||
int status;
|
||||
pthread_t threadId;
|
||||
long end_time;
|
||||
|
||||
puts( "\n\n*** POSIX TIME TEST MUTEX 05 ***" );
|
||||
|
||||
for ( i=0 ; i < OPERATION_COUNT ; i++ ) {
|
||||
status = pthread_create( &threadId, NULL, Blockers, NULL );
|
||||
rtems_test_assert( status == 0 );
|
||||
}
|
||||
status = pthread_create( &threadId, NULL, Blocker, NULL );
|
||||
rtems_test_assert( status == 0 );
|
||||
|
||||
/*
|
||||
* Deliberately create the mutex after the threads. This way if the
|
||||
@@ -73,11 +61,11 @@ void *POSIX_Init(
|
||||
rtems_test_assert( status == 0 );
|
||||
|
||||
/*
|
||||
* Let the other threads start so the thread startup overhead,
|
||||
* Let the other thread start so the thread startup overhead,
|
||||
* is accounted for. When we return, we can start the benchmark.
|
||||
*/
|
||||
sched_yield();
|
||||
/* let other threads run */
|
||||
/* let other thread run */
|
||||
|
||||
benchmark_timer_initialize();
|
||||
status = pthread_mutex_unlock( &MutexId );
|
||||
@@ -87,7 +75,7 @@ void *POSIX_Init(
|
||||
put_time(
|
||||
"pthread_mutex_unlock (no preemption)",
|
||||
end_time,
|
||||
OPERATION_COUNT,
|
||||
1,
|
||||
0,
|
||||
0
|
||||
);
|
||||
@@ -103,7 +91,7 @@ void *POSIX_Init(
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS OPERATION_COUNT + 1
|
||||
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
|
||||
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
|
||||
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user