Ignore:
Timestamp:
Jun 23, 2016, 9:49:22 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
a4a307d
Parents:
b364d38
git-author:
Sebastian Huber <sebastian.huber@…> (06/23/16 09:49:22)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/24/16 08:28:02)
Message:

posix: Fix pthread_create()

Do not access data of the executing thread without proper locks.

File:
1 edited

Legend:

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

    rb364d38 r51e008dd  
    2828#include <rtems/posix/priorityimpl.h>
    2929#include <rtems/posix/pthreadimpl.h>
     30#include <rtems/score/assert.h>
    3031#include <rtems/score/cpusetimpl.h>
    3132#include <rtems/score/threadimpl.h>
     
    104105
    105106  executing = _Thread_Get_executing();
    106   scheduler = _Scheduler_Get_own( executing );
    107107
    108108  /*
     
    116116  switch ( the_attr->inheritsched ) {
    117117    case PTHREAD_INHERIT_SCHED:
    118       api = executing->API_Extensions[ THREAD_API_POSIX ];
    119       schedpolicy = api->Attributes.schedpolicy;
    120       schedparam  = api->Attributes.schedparam;
     118      error = pthread_getschedparam(
     119        pthread_self(),
     120        &schedpolicy,
     121        &schedparam
     122      );
     123      _Assert( error == 0 );
    121124      break;
    122125
Note: See TracChangeset for help on using the changeset viewer.