source:
rtems/testsuites/mptests/mp10/task2.c
@
7753aa9f
Last change on this file since 7753aa9f was d7a0857, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:31 | |
---|---|
|
|
File size: 1.0 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 | #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 | } |
Note: See TracBrowser
for help on using the repository browser.