[PATCH] psxtests/psxkey07: Do not allocate task IDs
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue Mar 11 13:22:29 UTC 2014
---
testsuites/psxtests/psxkey07/init.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/testsuites/psxtests/psxkey07/init.c b/testsuites/psxtests/psxkey07/init.c
index 090fc95..2181bb2 100644
--- a/testsuites/psxtests/psxkey07/init.c
+++ b/testsuites/psxtests/psxkey07/init.c
@@ -60,7 +60,6 @@ rtems_task Test_Thread(rtems_task_argument argument)
rtems_task Init(rtems_task_argument argument)
{
- rtems_id *thread_p;
rtems_status_code rc;
int sc;
struct timespec delay_request;
@@ -95,8 +94,8 @@ rtems_task Init(rtems_task_argument argument)
greedy = rtems_workspace_greedy_allocate( &max_free_size, 1 );
for ( ; ; ) {
- thread_p = malloc( sizeof( rtems_id ) );
- rtems_test_assert( thread_p );
+ rtems_id task_id;
+
pthread_mutex_lock( &mutex1 );
rc = rtems_task_create(
@@ -105,7 +104,7 @@ rtems_task Init(rtems_task_argument argument)
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
- thread_p
+ &task_id
);
rtems_test_assert(
( rc == RTEMS_SUCCESSFUL ) || ( rc == RTEMS_UNSATISFIED )
@@ -113,7 +112,7 @@ rtems_task Init(rtems_task_argument argument)
);
if ( rc == RTEMS_SUCCESSFUL ) {
- rc = rtems_task_start( *thread_p, Test_Thread, 0 );
+ rc = rtems_task_start( task_id, Test_Thread, 0 );
rtems_test_assert( rc == RTEMS_SUCCESSFUL );
}
--
1.7.7
More information about the devel
mailing list