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_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-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 | |
---|
24 | void *Task_3( |
---|
25 | void *argument |
---|
26 | ) |
---|
27 | { |
---|
28 | int status; |
---|
29 | |
---|
30 | Task_id = pthread_self(); |
---|
31 | printf( "Task_3: ID is 0x%08" PRIxpthread_t "\n", Task_id ); |
---|
32 | |
---|
33 | status = pthread_mutex_lock( &Mutex_id ); |
---|
34 | rtems_test_assert( !status ); |
---|
35 | |
---|
36 | puts( "Task_3: pthread_cond_wait" ); |
---|
37 | status = pthread_cond_wait( &Cond1_id, &Mutex_id ); |
---|
38 | if ( status != EINVAL ) |
---|
39 | printf( "status = %d\n", status ); |
---|
40 | rtems_test_assert( status == EINVAL ); |
---|
41 | puts( "Task_3: pthread_cond_wait - EINVAL (mutex not locked after signal)"); |
---|
42 | |
---|
43 | puts( "Task_3: task exit" ); |
---|
44 | pthread_exit( NULL ); |
---|
45 | |
---|
46 | return NULL; /* just so the compiler thinks we returned something */ |
---|
47 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.