source: rtems/testsuites/psxtests/psx02/task.c @ 698c2e50

4.115
Last change on this file since 698c2e50 was 698c2e50, checked in by Sebastian Huber <sebastian.huber@…>, on 03/25/14 at 07:06:16

tests/psxtests: Use <rtems/test.h>

  • Property mode set to 100644
File size: 1006 bytes
Line 
1/*  Task_1_through_3
2 *
3 *  This routine serves as a test task.  It verifies the basic task
4 *  switching capabilities of the executive.
5 *
6 *  Input parameters:
7 *    argument - task argument
8 *
9 *  Output parameters:  NONE
10 *
11 *  COPYRIGHT (c) 1989-2009.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifdef HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include "system.h"
24#include <signal.h>
25
26void *Task_1_through_3(
27  void *argument
28)
29{
30  unsigned int seconds;
31  int          i;
32  int          status;
33
34  for ( i=0 ; i<5 ; i++ ) {
35    print_current_time( "Task1: ", "" );
36    status = pthread_kill( Init_id, SIGUSR1 );
37    rtems_test_assert( !status );
38
39    seconds = sleep( 1 );
40    rtems_test_assert( !seconds );
41  }
42  TEST_END();
43  rtems_test_exit( 0 );
44
45  return NULL; /* just so the compiler thinks we returned something */
46}
Note: See TracBrowser for help on using the repository browser.