fixed psxtmthread02 test, updated .csv to be in sync and added test .docs

This commit is contained in:
Daniel Ramirez
2013-11-30 15:42:38 -06:00
committed by Joel Sherrill
parent 135e957616
commit 115e059131
9 changed files with 127 additions and 42 deletions

View File

@@ -1,5 +1,5 @@
/*
* COPYRIGHT (c) 1989-2012.
* COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -23,19 +23,29 @@ void *thread(void *argument);
void benchmark_pthread_create(void)
{
long end_time;
int status;
pthread_t thread_ID;
pthread_attr_t attr;
struct sched_param param;
pthread_attr_init(&attr);
pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1;
pthread_attr_setschedparam(&attr, &param);
/* create second thread with max priority and get preempted on creation */
benchmark_timer_initialize();
status = pthread_create(&thread_ID, NULL, thread, NULL);
rtems_test_assert( status == 0 );
status = pthread_create(&thread_ID, &attr, thread, NULL);
}
void *thread(
void *argument
)
{
long end_time;
end_time = benchmark_timer_read();
rtems_test_assert( status == 0 );
put_time(
"pthread_create - preempt",
end_time,
@@ -43,14 +53,6 @@ void benchmark_pthread_create(void)
0,
0
);
}
void *thread(
void *argument
)
{
//Empty thread used in pthread_create().
return NULL;
}