4.104.115
Last change
on this file since 712726d was
712726d,
checked in by Joel Sherrill <joel.sherrill@…>, on 08/19/09 at 14:55:24
|
2009-08-19 Joel Sherrill <joel.sherrill@…>
- psx07/init.c, psx07/psx07.scn, psx07/system.h, psx07/task.c: Update
test to reflect not allowing poriority changes when mutex is locked.
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | /* Task_1 |
---|
2 | * |
---|
3 | * This routine serves as a test task. It verifies the basic task |
---|
4 | * switching capabilities of the executive. |
---|
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 | #include <time.h> |
---|
23 | #include <sched.h> |
---|
24 | |
---|
25 | void *Task_1( |
---|
26 | void *argument |
---|
27 | ) |
---|
28 | { |
---|
29 | puts( "Task_1 - exitting" ); |
---|
30 | pthread_exit( NULL ); |
---|
31 | |
---|
32 | return NULL; /* just so the compiler thinks we returned something */ |
---|
33 | } |
---|
34 | |
---|
35 | void *Task_2( |
---|
36 | void *argument |
---|
37 | ) |
---|
38 | { |
---|
39 | int i = 0; |
---|
40 | time_t now, start; |
---|
41 | |
---|
42 | /* |
---|
43 | * Change our priority so we are running at a logically higher |
---|
44 | * priority than our "ss_high_priority". This should result in |
---|
45 | * our replenishment period not touching our priority. |
---|
46 | */ |
---|
47 | |
---|
48 | /* |
---|
49 | * Consume time so the cpu budget callout will run. |
---|
50 | * |
---|
51 | * DO NOT BLOCK!!! |
---|
52 | */ |
---|
53 | start = time(&start); |
---|
54 | while( i <= 10 ) { |
---|
55 | do { |
---|
56 | now = time(&now); |
---|
57 | } while (start == now); |
---|
58 | start = time(&start); |
---|
59 | |
---|
60 | printf( "Time elapsed Task_2: %2d (seconds)\n", i++ ); |
---|
61 | } |
---|
62 | |
---|
63 | puts( "Task_2 - exitting" ); |
---|
64 | pthread_exit( NULL ); |
---|
65 | return NULL; |
---|
66 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.