diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-01-07 09:55:45 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-01-11 08:47:01 +0100 |
commit | ccd54344d904b657123e4e4ba795a32212382be2 (patch) | |
tree | d490d77b6173f586137036ed07ec5bd27d8ca65a /cpukit/posix/src/pthreadcreate.c | |
parent | smptests/README: Delete obsolete information (diff) | |
download | rtems-ccd54344d904b657123e4e4ba795a32212382be2.tar.bz2 |
score: Introduce Thread_Entry_information
This avoids potential dead code in _Thread_Handler(). It gets rid of
the dangerous function pointer casts.
Update #2514.
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/pthreadcreate.c | 18 |
1 files changed, 10 insertions, 8 deletions
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) /* |