mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-30 07:10:52 +08:00
psxtests/psxkey07: Limit workspace size
This avoids large test execution times on targets with a big RAM.
This commit is contained in:
@@ -63,6 +63,8 @@ rtems_task Init(rtems_task_argument argument)
|
||||
rtems_status_code rc;
|
||||
int sc;
|
||||
struct timespec delay_request;
|
||||
uintptr_t max_free_size = 13 * RTEMS_MINIMUM_STACK_SIZE;
|
||||
void *greedy;
|
||||
|
||||
all_thread_created = 0;
|
||||
|
||||
@@ -88,6 +90,9 @@ rtems_task Init(rtems_task_argument argument)
|
||||
sc = pthread_key_create( &Key, NULL );
|
||||
rtems_test_assert( !sc );
|
||||
|
||||
/* Reduce workspace size if necessary to shorten test time */
|
||||
greedy = rtems_workspace_greedy_allocate( &max_free_size, 1 );
|
||||
|
||||
for ( ; ; ) {
|
||||
thread_p = malloc( sizeof( rtems_id ) );
|
||||
rtems_test_assert( thread_p );
|
||||
@@ -129,6 +134,9 @@ rtems_task Init(rtems_task_argument argument)
|
||||
pthread_cond_wait( &set_condition_var, &mutex1 );
|
||||
pthread_mutex_unlock( &mutex1 );
|
||||
}
|
||||
|
||||
rtems_workspace_greedy_free( greedy );
|
||||
|
||||
printf(
|
||||
"Init - %d pthreads have been created - OK\n"
|
||||
"Init - %d pthreads have been setted key data - OK\n",
|
||||
|
||||
Reference in New Issue
Block a user