source: rtems/testsuites/psxtmtests/psxtmcond05/init.c @ 8fbe2e6

4.11
Last change on this file since 8fbe2e6 was 8fbe2e6, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2014 at 1:59:49 PM

Use correct prototype of benchmark_timer_read()

This change starts with removing the effectively empty file
timerdrv.h. The prototypes for benchmark_timer_XXX() were in
btimer.h which was not universally used. Thus every use of
timerdrv.h had to be changed to btimer.h. Then the prototypes
for benchmark_timer_read() had to be adjusted to return
benchmark_timer_t rather than int or uint32_t.

I took this opportunity to also correct the file headers to
separate the copyright from the file description comments which
is needed to ensure the copyright isn't propagated into Doxygen
output.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2013.
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.org/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/btimer.h>
17#include "test_support.h"
18
19const char rtems_test_name[] = "PSXTMCOND 05";
20
21/* forward declarations to avoid warnings */
22void *POSIX_Init(void *argument);
23void benchmark_broadcast(void);
24
25pthread_cond_t CondID;
26
27void benchmark_broadcast(void)
28{
29  uint32_t end_time;
30  int      status;
31
32  benchmark_timer_initialize();
33  status = pthread_cond_broadcast(&CondID);
34  end_time = benchmark_timer_read();
35  rtems_test_assert( status == 0 );
36
37  put_time(
38    "pthread_cond_broadcast: no threads waiting",
39    end_time,
40    1,        /* Only executed once */
41    0,
42    0
43  );
44
45}
46
47void *POSIX_Init(
48  void *argument
49)
50{
51
52  TEST_BEGIN();
53
54  pthread_cond_init(&CondID, NULL);
55
56  benchmark_broadcast();
57
58  TEST_END();
59  rtems_test_exit(0);
60}
61
62/* configuration information */
63
64#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
65#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
66
67#define CONFIGURE_MAXIMUM_POSIX_THREADS     1
68#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 2
69#define CONFIGURE_POSIX_INIT_THREAD_TABLE
70
71#define CONFIGURE_INIT
72
73#include <rtems/confdefs.h>
74/* end of file */
Note: See TracBrowser for help on using the repository browser.