Changeset 0c34dbf3 in rtems


Ignore:
Timestamp:
Jun 13, 2016, 1:22:47 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
3eda7e5
Parents:
fc30ac5
git-author:
Sebastian Huber <sebastian.huber@…> (06/13/16 13:22:47)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/13/16 13:38:14)
Message:

posix: Add pthread_setschedprio()

Close #2734.

Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/Makefile.am

    rfc30ac5 r0c34dbf3  
    134134    src/pthreadsetschedparam.c src/pthreadsigmask.c \
    135135    src/psxpriorityisvalid.c src/psxtransschedparam.c
     136libposix_a_SOURCES += src/pthreadsetschedprio.c
    136137
    137138## RTEMS specific support methods
  • testsuites/psxtests/psx05/init.c

    rfc30ac5 r0c34dbf3  
    201201  rtems_test_assert( counter == 1 );
    202202
     203  status = pthread_setschedprio( pthread_self(), param.sched_priority + 1 );
     204  rtems_test_assert( status == 0 );
     205
     206  rtems_test_assert( counter == 1 );
     207
     208  status = pthread_setschedprio( pthread_self(), param.sched_priority );
     209  rtems_test_assert( status == 0 );
     210
     211  rtems_test_assert( counter == 1 );
     212
    203213  counter = -1;
    204214  sched_yield();
     
    208218  rtems_test_assert( exit_code == &counter );
    209219  rtems_test_assert( counter == -1 );
     220}
     221
     222static void test_errors_pthread_setschedprio( void )
     223{
     224  int                status;
     225  int                policy;
     226  struct sched_param param;
     227
     228  status = pthread_getschedparam( pthread_self(), &policy, &param );
     229  rtems_test_assert( status == 0 );
     230
     231  status = pthread_setschedprio( pthread_self(), INT_MAX );
     232  rtems_test_assert( status == EINVAL );
     233
     234  status = pthread_setschedprio( 0xdeadbeef, param.sched_priority );
     235  rtems_test_assert( status == ESRCH );
     236
     237  status = pthread_setschedprio( pthread_self(), param.sched_priority );
     238  rtems_test_assert( status == 0 );
    210239}
    211240
     
    233262  test_get_priority();
    234263  test_set_priority();
     264  test_errors_pthread_setschedprio();
    235265
    236266  /* set the time of day, and print our buffer in multiple ways */
Note: See TracChangeset for help on using the changeset viewer.