From ccd54344d904b657123e4e4ba795a32212382be2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 7 Jan 2016 09:55:45 +0100 Subject: score: Introduce Thread_Entry_information This avoids potential dead code in _Thread_Handler(). It gets rid of the dangerous function pointer casts. Update #2514. --- cpukit/posix/src/pthreadcreate.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'cpukit/posix/src/pthreadcreate.c') diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c index 59c4e66e9d..611477ec69 100644 --- a/cpukit/posix/src/pthreadcreate.c +++ b/cpukit/posix/src/pthreadcreate.c @@ -52,6 +52,15 @@ int pthread_create( void *arg ) { + Thread_Entry_information entry = { + .adaptor = _Thread_Entry_adaptor_pointer, + .Kinds = { + .Pointer = { + .entry = start_routine, + .argument = arg + } + } + }; const pthread_attr_t *the_attr; Priority_Control core_priority; Thread_CPU_budget_algorithms budget_algorithm; @@ -219,14 +228,7 @@ int pthread_create( /* * POSIX threads are allocated and started in one operation. */ - status = _Thread_Start( - the_thread, - THREAD_START_POINTER, - start_routine, - arg, - 0, /* unused */ - NULL - ); + status = _Thread_Start( the_thread, &entry, NULL ); #if defined(RTEMS_DEBUG) /* -- cgit v1.2.3