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
|
Rev | Line | |
---|
[79f189e] | 1 | /* Task_2 |
---|
| 2 | * |
---|
| 3 | * This routine serves as a test task. |
---|
| 4 | * |
---|
| 5 | * Input parameters: |
---|
| 6 | * argument - task argument |
---|
| 7 | * |
---|
| 8 | * Output parameters: NONE |
---|
| 9 | * |
---|
[2317457] | 10 | * COPYRIGHT (c) 1989-2009. |
---|
[79f189e] | 11 | * On-Line Applications Research Corporation (OAR). |
---|
| 12 | * |
---|
[98e4ebf5] | 13 | * The license and distribution terms for this file may be |
---|
| 14 | * found in the file LICENSE in this distribution or at |
---|
[c499856] | 15 | * http://www.rtems.org/license/LICENSE. |
---|
[79f189e] | 16 | */ |
---|
| 17 | |
---|
[cafefbf] | 18 | #ifdef HAVE_CONFIG_H |
---|
| 19 | #include "config.h" |
---|
| 20 | #endif |
---|
| 21 | |
---|
[79f189e] | 22 | #include "system.h" |
---|
| 23 | #include <errno.h> |
---|
| 24 | |
---|
| 25 | void *Task_2( |
---|
| 26 | void *argument |
---|
| 27 | ) |
---|
| 28 | { |
---|
| 29 | int status; |
---|
| 30 | |
---|
| 31 | printf( "Task 2: pthread_mutex_lock unavailable (inherit case)\n" ); |
---|
| 32 | status = pthread_mutex_lock( &Mutex2_id ); |
---|
[7e230f10] | 33 | if ( status ) |
---|
| 34 | printf( "status =%d\n", status ); |
---|
[33c46f1] | 35 | rtems_test_assert( !status ); |
---|
[7e230f10] | 36 | printf( "Task 2: mutex acquired\n" ); |
---|
[79f189e] | 37 | |
---|
| 38 | /* switch to init */ |
---|
| 39 | |
---|
| 40 | printf( "Task 2: unlock Mutex 2\n" ); |
---|
| 41 | status = pthread_mutex_unlock( &Mutex2_id ); |
---|
[33c46f1] | 42 | rtems_test_assert( !status ); |
---|
[79f189e] | 43 | |
---|
| 44 | printf( "Task 2: exit\n" ); |
---|
| 45 | pthread_exit( NULL ); |
---|
| 46 | |
---|
| 47 | /* switch to Init */ |
---|
| 48 | |
---|
| 49 | return NULL; /* just so the compiler thinks we returned something */ |
---|
| 50 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.