From 64ba1a9606c86f54d66d1d5cc638fb9aff7338a2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 8 Nov 2017 15:29:14 +0100 Subject: posix: Change created_with_explicit_scheduler Remove POSIX_API_Control::created_with_explicit_scheduler. Add Thread_Control::was_created_with_inherited_scheduler. This fixes also pthread_getattr_np() for Classic tasks. Update #2514. --- cpukit/posix/include/rtems/posix/threadsup.h | 3 --- cpukit/posix/src/pthreadcreate.c | 4 ++-- cpukit/posix/src/pthreadgetattrnp.c | 6 +++--- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'cpukit/posix') diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h index 4b62b19e1c..d3ee5b28bb 100644 --- a/cpukit/posix/include/rtems/posix/threadsup.h +++ b/cpukit/posix/include/rtems/posix/threadsup.h @@ -40,9 +40,6 @@ extern "C" { * each thread in a system with POSIX configured. */ typedef struct { - /** Created with explicit or inherited scheduler. */ - bool created_with_explicit_scheduler; - /** * @brief Control block for the sporadic server scheduling policy. */ diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c index 348bf68430..46fe1e7412 100644 --- a/cpukit/posix/src/pthreadcreate.c +++ b/cpukit/posix/src/pthreadcreate.c @@ -250,8 +250,8 @@ int pthread_create( api->signals_unblocked = executing_api->signals_unblocked; - api->created_with_explicit_scheduler = - ( the_attr->inheritsched == PTHREAD_EXPLICIT_SCHED ); + the_thread->was_created_with_inherited_scheduler = + ( the_attr->inheritsched == PTHREAD_INHERIT_SCHED ); _Priority_Node_set_priority( &api->Sporadic.Low_priority, core_low_prio ); api->Sporadic.sched_ss_repl_period = diff --git a/cpukit/posix/src/pthreadgetattrnp.c b/cpukit/posix/src/pthreadgetattrnp.c index 9df5bad38f..6690bda988 100644 --- a/cpukit/posix/src/pthreadgetattrnp.c +++ b/cpukit/posix/src/pthreadgetattrnp.c @@ -60,10 +60,10 @@ int pthread_getattr_np( attr->stackaddr = the_thread->Start.Initial_stack.area; attr->stacksize = the_thread->Start.Initial_stack.size; - if ( api->created_with_explicit_scheduler ) { - attr->inheritsched = PTHREAD_EXPLICIT_SCHED; - } else { + if ( the_thread->was_created_with_inherited_scheduler ) { attr->inheritsched = PTHREAD_INHERIT_SCHED; + } else { + attr->inheritsched = PTHREAD_EXPLICIT_SCHED; } scheduler = _Thread_Scheduler_get_home( the_thread ); -- cgit v1.2.3