source: rtems/testsuites/psxtests/psx05/task3.c @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on 04/22/97 at 17:20:27

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*  Task_3
2 *
3 *  This routine serves as a test task.
4 *
5 *  Input parameters:
6 *    argument - task argument
7 *
8 *  Output parameters:  NONE
9 *
10 *  COPYRIGHT (c) 1989-1997.
11 *  On-Line Applications Research Corporation (OAR).
12 *  Copyright assigned to U.S. Government, 1994.
13 *
14 *  The license and distribution terms for this file may in
15 *  the file LICENSE in this distribution or at
16 *  http://www.OARcorp.com/rtems/license.html.
17 *
18 *  $Id$
19 */
20
21#include "system.h"
22#include <errno.h>
23
24void *Task_3(
25  void *argument
26)
27{
28  int                 status;
29  struct sched_param  param;
30  int                 policy;
31
32  printf( "Task 3: pthread_mutex_lock unavailable (inherit case)\n" );
33  status = pthread_mutex_lock( &Mutex2_id );
34  printf( "Task 3: mutex acquired\n" );
35  assert( !status );
36
37  printf( "Task 3: unlock Mutex 2\n" );
38  status = pthread_mutex_unlock( &Mutex2_id );
39  assert( !status );
40
41  status = pthread_getschedparam( pthread_self(), &policy, &param );
42  assert( !status );
43  printf( "Task 3: pthread_getschedparam priority = %d\n", param.sched_priority );
44
45  printf( "Task 3: exit\n" );
46  pthread_exit( NULL );
47
48     /* switch to Init */
49
50  return NULL; /* just so the compiler thinks we returned something */
51}
Note: See TracBrowser for help on using the repository browser.