1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2012. |
---|
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 <timesys.h> |
---|
15 | #include <pthread.h> |
---|
16 | #include <rtems/timerdrv.h> |
---|
17 | #include "test_support.h" |
---|
18 | |
---|
19 | /* forward declarations to avoid warnings */ |
---|
20 | void *POSIX_Init(void *argument); |
---|
21 | void benchmark_broadcast(void); |
---|
22 | |
---|
23 | pthread_cond_t CondID; |
---|
24 | |
---|
25 | void benchmark_broadcast(void) |
---|
26 | { |
---|
27 | long end_time; |
---|
28 | int status; |
---|
29 | |
---|
30 | benchmark_timer_initialize(); |
---|
31 | status = pthread_cond_broadcast(&CondID); |
---|
32 | end_time = benchmark_timer_read(); |
---|
33 | rtems_test_assert( status == 0 ); |
---|
34 | |
---|
35 | put_time( |
---|
36 | "pthread_cond_broadcast - no threads waiting", |
---|
37 | end_time, |
---|
38 | 1, /* Only executed once */ |
---|
39 | 0, |
---|
40 | 0 |
---|
41 | ); |
---|
42 | |
---|
43 | } |
---|
44 | |
---|
45 | void *POSIX_Init( |
---|
46 | void *argument |
---|
47 | ) |
---|
48 | { |
---|
49 | |
---|
50 | puts( "\n\n*** POSIX TIME TEST PSXTMCOND05 ***" ); |
---|
51 | |
---|
52 | pthread_cond_init(&CondID, NULL); |
---|
53 | |
---|
54 | benchmark_broadcast(); |
---|
55 | |
---|
56 | puts( "*** END OF POSIX TIME TEST PSXTMCOND05 ***" ); |
---|
57 | rtems_test_exit(0); |
---|
58 | } |
---|
59 | |
---|
60 | /* configuration information */ |
---|
61 | |
---|
62 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
63 | #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
---|
64 | |
---|
65 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 1 |
---|
66 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 2 |
---|
67 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
68 | |
---|
69 | #define CONFIGURE_INIT |
---|
70 | |
---|
71 | #include <rtems/confdefs.h> |
---|
72 | /* end of file */ |
---|