source: rtems/testsuites/psxtmtests/psxtmmutex01/init.c @ add2977

4.115
Last change on this file since add2977 was add2977, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/19/11 at 15:27:27

2011-10-19 Ralf Corsépius <ralf.corsepius@…>

  • psxtmbarrier01/init.c, psxtmbarrier02/init.c, psxtmbarrier03/init.c, psxtmkey01/init.c, psxtmkey02/init.c, psxtmmq01/init.c, psxtmmutex01/init.c, psxtmmutex02/init.c, psxtmmutex03/init.c, psxtmmutex04/init.c, psxtmmutex05/init.c, psxtmmutex06/init.c, psxtmmutex07/init.c, psxtmnanosleep01/init.c, psxtmnanosleep02/init.c, psxtmrwlock01/init.c, psxtmrwlock02/init.c, psxtmrwlock03/init.c, psxtmrwlock04/init.c, psxtmrwlock05/init.c, psxtmrwlock06/init.c, psxtmrwlock07/init.c, psxtmsem01/init.c, psxtmsem02/init.c, psxtmsem03/init.c, psxtmsem04/init.c, psxtmsem05/init.c, psxtmsleep01/init.c, psxtmsleep02/init.c, psxtmthread03/init.c: Use benchmark_timer_t for benchmark_timer values (Avoid 64bit arch issues).
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
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 *  $Id$
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <timesys.h>
17#include <rtems/timerdrv.h>
18#include <errno.h>
19#include <pthread.h>
20#include "test_support.h"
21
22pthread_mutex_t MutexId;
23
24void test_mutex_create(void)
25{
26  benchmark_timer_t end_time;
27  int  status;
28
29  benchmark_timer_initialize();
30    status = pthread_mutex_init( &MutexId, NULL );
31  end_time = benchmark_timer_read();
32  rtems_test_assert( status == 0 );
33
34  put_time(
35    "pthread_mutex_init",
36    end_time,
37    1,
38    0,
39    0
40  );
41}
42
43void test_mutex_destroy(void)
44{
45  benchmark_timer_t end_time;
46  int  status;
47
48  benchmark_timer_initialize();
49    status = pthread_mutex_destroy( &MutexId );
50  end_time = benchmark_timer_read();
51  rtems_test_assert( status == 0 );
52
53  put_time(
54    "pthread_mutex_destroy",
55    end_time,
56    1,
57    0,
58    0
59  );
60}
61
62void *POSIX_Init(
63  void *argument
64)
65{
66
67  puts( "\n\n*** POSIX TIME TEST PSXTMMUTEX01 ***" );
68
69  test_mutex_create();
70  test_mutex_destroy();
71
72  puts( "*** END OF POSIX TIME TEST PSXTMMUTEX01 ***" );
73
74  rtems_test_exit(0);
75}
76
77/* configuration information */
78
79#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
80#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
81
82#define CONFIGURE_MAXIMUM_POSIX_THREADS     1
83#define CONFIGURE_MAXIMUM_POSIX_MUTEXES     1
84#define CONFIGURE_POSIX_INIT_THREAD_TABLE
85
86#define CONFIGURE_INIT
87
88#include <rtems/confdefs.h>
89/* end of file */
Note: See TracBrowser for help on using the repository browser.