source: rtems/testsuites/psxtmtests/psxtmthread02/init.c @ 7b369af

4.115
Last change on this file since 7b369af was 7b369af, checked in by Sebastian Huber <sebastian.huber@…>, on 04/11/13 at 11:58:33

testsuites: Fix warnings

  • Property mode set to 100644
File size: 1.5 KB
Line 
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 */
20void *POSIX_Init(void *argument);
21void benchmark_pthread_create(void);
22void *thread(void *argument);
23
24void benchmark_pthread_create(void)
25{
26  long end_time;
27  int  status;
28  pthread_t thread_ID;
29
30  benchmark_timer_initialize();
31 
32  status = pthread_create(&thread_ID, NULL, thread, NULL);
33  rtems_test_assert( status == 0 );
34 
35  end_time = benchmark_timer_read();
36
37  rtems_test_assert( status == 0 );
38
39  put_time(
40    "pthread_create - preempt",
41    end_time,
42    1,        /* Only executed once */
43    0,
44    0
45  );
46
47}
48
49void *thread(
50  void *argument
51)
52{
53  //Empty thread used in pthread_create().
54  return NULL;
55}
56
57void *POSIX_Init(
58  void *argument
59)
60{
61
62  puts( "\n\n*** POSIX TIME TEST PSXTMTHREAD02 ***" );
63
64  benchmark_pthread_create();
65
66  puts( "*** END OF POSIX TIME TEST PSXTMTHREAD02 ***" );
67  rtems_test_exit(0);
68}
69
70/* configuration information */
71
72#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
73#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
74
75#define CONFIGURE_MAXIMUM_POSIX_THREADS     2
76#define CONFIGURE_POSIX_INIT_THREAD_TABLE
77
78#define CONFIGURE_INIT
79
80#include <rtems/confdefs.h>
81/* end of file */
Note: See TracBrowser for help on using the repository browser.