source: rtems/testsuites/psxtests/psxautoinit02/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.6 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.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include "tmacros.h"
15#include <pthread.h>
16#include <errno.h>
17
18/* forward declarations to avoid warnings */
19void *POSIX_Init(void *argument);
20
21void *POSIX_Init(
22  void *argument
23)
24{
25  int            sc;
26  pthread_cond_t cond1;
27  pthread_cond_t cond2;
28
29  puts( "\n\n*** POSIX TEST -- AUTOMATIC INITIALIZAITON 02 ***" );
30
31  cond1 = PTHREAD_COND_INITIALIZER;
32  cond2 = PTHREAD_COND_INITIALIZER;
33  puts( "Init - pthread_cond_broadcast - auto initialize - OK" );
34  sc = pthread_cond_broadcast( &cond1 );
35  fatal_posix_service_status( sc, 0, "cond broadcast OK" );
36
37  puts( "Init - pthread_cond_broadcast - auto initialize - EINVAL" );
38  sc = pthread_cond_broadcast( &cond2 );
39  fatal_posix_service_status( sc, EINVAL, "cond lock EINVAL" );
40
41  puts( "Init - pthread_cond_destroy - OK" );
42  sc = pthread_cond_destroy( &cond1 );
43  fatal_posix_service_status( sc, 0, "cond destroy OK" );
44
45  puts( "*** END OF POSIX TEST AUTOMATIC INITIALIZATION 02 ***" );
46  rtems_test_exit( 0 );
47
48  return NULL; /* just so the compiler thinks we returned something */
49}
50
51#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
52#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
53
54#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
55#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1
56
57#define CONFIGURE_POSIX_INIT_THREAD_TABLE
58
59#define CONFIGURE_INIT
60#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.