source: rtems/c/src/tests/psxtests/psx10/task3.c @ b0c483ed

4.104.114.84.95
Last change on this file since b0c483ed was b0c483ed, checked in by Mark Johannes <Mark.Johannes@…>, on 08/14/96 at 17:18:02

task3: added to test error case in Wait_support for lock on mutex

  • Property mode set to 100644
File size: 1.1 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, 1990, 1991, 1992, 1993, 1994.
11 *  On-Line Applications Research Corporation (OAR).
12 *  All rights assigned to U.S. Government, 1994.
13 *
14 *  This material may be reproduced by or for the U.S. Government pursuant
15 *  to the copyright license under the clause at DFARS 252.227-7013.  This
16 *  notice must appear in all copies of this file and its derivatives.
17 *
18 *  $Id$
19 */
20
21#include "system.h"
22
23void *Task_3(
24  void *argument
25)
26{
27  int  status;
28
29  Task_id = pthread_self();
30  printf( "Task_3: ID is 0x%08x\n", Task_id );
31
32  status = pthread_mutex_lock( &Mutex_id );
33  assert( !status );
34
35  puts( "Task_3: pthread_cond_wait" );
36  status = pthread_cond_wait( &Cond1_id, &Mutex_id );
37  if ( status != EINVAL )
38    printf( "status = %d\n", status );
39  assert( status == EINVAL );
40  puts( "Task_3: pthread_cond_wait - EINVAL (mutex not locked after signal)");
41
42  puts( "Task_3: task exit" );
43  pthread_exit( NULL );
44
45  return NULL; /* just so the compiler thinks we returned something */
46}
Note: See TracBrowser for help on using the repository browser.