Changeset 2fcea4c in rtems


Ignore:
Timestamp:
Oct 17, 2017, 8:06:08 AM (21 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
2be22d4
Parents:
91ce012c
git-author:
Sebastian Huber <sebastian.huber@…> (10/17/17 08:06:08)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/17/17 08:12:10)
Message:

posix: Fix _POSIX_Threads_Create_extension()

The thread POSIX API control must be fully initialized in
_POSIX_Threads_Create_extension(), otherwise a pthread_setschedparam()
is broken for all threads not created with pthread_create().

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/pthread.c

    r91ce012c r2fcea4c  
    152152  _Watchdog_Preinitialize( &api->Sporadic.Timer, _Per_CPU_Get_by_index( 0 ) );
    153153  _Watchdog_Initialize( &api->Sporadic.Timer, _POSIX_Threads_Sporadic_timer );
     154  _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
    154155
    155156  return true;
  • cpukit/posix/src/pthreadcreate.c

    r91ce012c r2fcea4c  
    243243  api->schedpolicy = the_attr->schedpolicy;
    244244  api->schedparam = the_attr->schedparam;
    245   _Priority_Node_initialize( &api->Sporadic.Low_priority, core_low_prio );
    246   _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
     245  _Priority_Node_set_priority( &api->Sporadic.Low_priority, core_low_prio );
    247246
    248247  if ( schedpolicy == SCHED_SPORADIC ) {
  • testsuites/psxtests/psxclassic01/init.c

    r91ce012c r2fcea4c  
    5353  struct sigaction new_action;
    5454  sigset_t mask;
     55  int policy;
     56  struct sched_param param;
    5557
    5658  printf("test_task starting...\n");
     59
     60  sc = pthread_getschedparam( pthread_self(), &policy, &param );
     61  rtems_test_assert( sc == 0 );
     62
     63  sc = pthread_setschedparam( pthread_self(), policy, &param );
     64  rtems_test_assert( sc == 0 );
    5765
    5866  sc = sigemptyset (&new_action.sa_mask);
Note: See TracChangeset for help on using the changeset viewer.