source: rtems/c/src/tests/psxtests/psxhdrs/pthread22.c @ 6481405e

4.104.114.84.9
Last change on this file since 6481405e was 6481405e, checked in by Joel Sherrill <joel.sherrill@…>, on May 24, 1996 at 2:16:24 PM

added use of sporadic server scheduling parameters

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  This test file is used to verify that the header files associated with
3 *  the callout are correct.
4 *
5 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996.
6 *  On-Line Applications Research Corporation (OAR).
7 *  All rights assigned to U.S. Government, 1994.
8 *
9 *  This material may be reproduced by or for the U.S. Government pursuant
10 *  to the copyright license under the clause at DFARS 252.227-7013.  This
11 *  notice must appear in all copies of this file and its derivatives.
12 *
13 *  $Id$
14 */
15
16#include <pthread.h>
17 
18#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
19#error "RTEMS is support to have pthread_setschedparam"
20#endif
21
22void test( void )
23{
24  pthread_t           thread = 0;
25  int                 policy;
26  struct sched_param  param;
27  int                 result;
28
29  policy = SCHED_OTHER;
30  policy = SCHED_FIFO;
31  policy = SCHED_RR;
32#ifdef _POSIX_SPORADIC_SERVER
33  policy = SCHED_SPORADIC;
34#endif
35
36  /*
37   *  really should use sched_get_priority_min() and sched_get_priority_max()
38   */
39
40  param.sched_priority = 0;
41#ifdef _POSIX_SPORADIC_SERVER
42  param.ss_low_priority = 0;
43  param.ss_replenish_period.tv_sec = 0;
44  param.ss_replenish_period.tv_nsec = 0;
45  param.ss_initial_budget.tv_sec = 0;
46  param.ss_initial_budget.tv_nsec = 0;
47#endif
48
49  result = pthread_setschedparam( thread, policy, &param );
50}
Note: See TracBrowser for help on using the repository browser.