1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2009. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | */ |
---|
9 | |
---|
10 | #ifdef HAVE_CONFIG_H |
---|
11 | #include "config.h" |
---|
12 | #endif |
---|
13 | |
---|
14 | #include <tmacros.h> |
---|
15 | |
---|
16 | #include <sys/types.h> |
---|
17 | #include <rtems/score/threadq.h> |
---|
18 | |
---|
19 | void threadq_first_empty( |
---|
20 | const char *discipline_string, |
---|
21 | Thread_queue_Disciplines discipline |
---|
22 | ) |
---|
23 | { |
---|
24 | Thread_queue_Control tq; |
---|
25 | |
---|
26 | printf( "Init - initialize thread queue for %s\n", discipline_string ); |
---|
27 | _Thread_queue_Initialize( &tq, discipline, 0x01, 3 ); |
---|
28 | |
---|
29 | puts( "Init - _Thread_queue_Extract - thread not blocked on a thread queue" ); |
---|
30 | _Thread_queue_Extract( &tq, _Thread_Executing ); |
---|
31 | /* is there anything to check? */ |
---|
32 | } |
---|
33 | |
---|
34 | rtems_task Init( |
---|
35 | rtems_task_argument ignored |
---|
36 | ) |
---|
37 | { |
---|
38 | puts( "\n\n*** TEST THREAD QUEUE TEST 01 ***" ); |
---|
39 | |
---|
40 | threadq_first_empty( "FIFO", THREAD_QUEUE_DISCIPLINE_FIFO ); |
---|
41 | threadq_first_empty( "Priority", THREAD_QUEUE_DISCIPLINE_PRIORITY ); |
---|
42 | |
---|
43 | puts( "*** END OF TEST THREAD QUEUE TEST 01 ***" ); |
---|
44 | rtems_test_exit(0); |
---|
45 | } |
---|
46 | |
---|
47 | /* configuration information */ |
---|
48 | |
---|
49 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
50 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
---|
51 | |
---|
52 | #define CONFIGURE_MAXIMUM_TASKS 1 |
---|
53 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
54 | |
---|
55 | #define CONFIGURE_INIT |
---|
56 | #include <rtems/confdefs.h> |
---|
57 | |
---|
58 | /* global variables */ |
---|