OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [tests/] [mptests/] [mp10/] [task2.c] - Blame information for rev 1026

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  Test_task2
2
 *
3
 *  This task attempts to receive control of a global semaphore.
4
 *  It should never receive control of the semaphore.
5
 *
6
 *  Input parameters:
7
 *    argument - task argument
8
 *
9
 *  Output parameters:  NONE
10
 *
11
 *  COPYRIGHT (c) 1989-1999.
12
 *  On-Line Applications Research Corporation (OAR).
13
 *
14
 *  The license and distribution terms for this file may be
15
 *  found in the file LICENSE in this distribution or at
16
 *  http://www.OARcorp.com/rtems/license.html.
17
 *
18
 *  task2.c,v 1.7 1999/11/17 17:51:30 joel Exp
19
 */
20
 
21
#include "system.h"
22
 
23
rtems_task Test_task2(
24
  rtems_task_argument argument
25
)
26
{
27
  rtems_status_code status;
28
 
29
  puts( "Getting SMID of semaphore" );
30
 
31
  do {
32
    status = rtems_semaphore_ident(
33
      Semaphore_name[ 1 ],
34
      RTEMS_SEARCH_ALL_NODES,
35
      &Semaphore_id[ 1 ]
36
    );
37
  } while ( !rtems_is_status_successful( status ) );
38
 
39
  puts( "Attempting to acquire semaphore ..." );
40
  status = rtems_semaphore_obtain(
41
    Semaphore_id[ 1 ],
42
    RTEMS_DEFAULT_OPTIONS,
43
    RTEMS_NO_TIMEOUT
44
  );
45
  directive_failed( status, "rtems_semaphore_obtain" );
46
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.