source: rtems/testsuites/psxtests/psx05/task2.c @ 9a4eca5

5
Last change on this file since 9a4eca5 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*  Task_2
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-2009.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#ifdef HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include "system.h"
23#include <errno.h>
24
25void *Task_2(
26  void *argument
27)
28{
29  int status;
30
31  printf( "Task 2: pthread_mutex_lock unavailable (inherit case)\n" );
32  status = pthread_mutex_lock( &Mutex2_id );
33  if ( status )
34    printf( "status =%d\n", status );
35  rtems_test_assert( !status );
36  printf( "Task 2: mutex acquired\n" );
37
38     /* switch to init */
39
40  printf( "Task 2: unlock Mutex 2\n" );
41  status = pthread_mutex_unlock( &Mutex2_id );
42  rtems_test_assert( !status );
43
44  printf( "Task 2: exit\n" );
45  pthread_exit( NULL );
46
47     /* switch to Init */
48
49  return NULL; /* just so the compiler thinks we returned something */
50}
Note: See TracBrowser for help on using the repository browser.