source: rtems/testsuites/sptests/sp05/task3.c

Last change on this file was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 973 bytes
Line 
1/*  Task_3
2 *
3 *  This routine serves as a test task.  Makes sure a task can suspend
4 *  itself.
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
25rtems_task Task_3(
26  rtems_task_argument argument
27)
28{
29  rtems_status_code status;
30
31  puts( "TA3 - rtems_task_suspend - suspend self" );
32  status = rtems_task_suspend( RTEMS_SELF );
33  directive_failed( status, "rtems_task_suspend of TA3" );
34
35  while( FOREVER ) {
36    puts( "TA3 - rtems_task_wake_after - sleep 1 second" );
37    status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
38    directive_failed( status, "rtems_task_wake_after of TA3" );
39  }
40}
Note: See TracBrowser for help on using the repository browser.