source: rtems/testsuites/mptests/mp10/task2.c @ a4bc4d6e

4.115
Last change on this file since a4bc4d6e was a4bc4d6e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 10:00:39

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*  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.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#ifdef HAVE_CONFIG_H
22#include "config.h"
23#endif
24
25#include "system.h"
26
27rtems_task Test_task2(
28  rtems_task_argument argument
29)
30{
31  rtems_status_code status;
32
33  puts( "Getting SMID of semaphore" );
34
35  do {
36    status = rtems_semaphore_ident(
37      Semaphore_name[ 1 ],
38      RTEMS_SEARCH_ALL_NODES,
39      &Semaphore_id[ 1 ]
40    );
41  } while ( !rtems_is_status_successful( status ) );
42
43  puts( "Attempting to acquire semaphore ..." );
44  status = rtems_semaphore_obtain(
45    Semaphore_id[ 1 ],
46    RTEMS_DEFAULT_OPTIONS,
47    RTEMS_NO_TIMEOUT
48  );
49  directive_failed( status, "rtems_semaphore_obtain" );
50}
Note: See TracBrowser for help on using the repository browser.