source: rtems/testsuites/psxtmtests/psxtmcond05/init.c @ c499856

4.115
Last change on this file since c499856 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.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/timerdrv.h>
17#include "test_support.h"
18
19/* forward declarations to avoid warnings */
20void *POSIX_Init(void *argument);
21void benchmark_broadcast(void);
22
23pthread_cond_t CondID;
24
25void 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
45void *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 */
Note: See TracBrowser for help on using the repository browser.