OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [psxtests/] [psx03/] [task.c] - Blame information for rev 590

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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-1999.
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.OARcorp.com/rtems/license.html.
17
 *
18
 *  $Id: task.c,v 1.2 2001-09-27 12:02:23 chris Exp $
19
 */
20
 
21
#include "system.h"
22
#include <signal.h>
23
 
24
void *Task_1(
25
  void *argument
26
)
27
{
28
  int status;
29
 
30
  /* send SIGUSR2 to Init which is waiting on SIGUSR1 */
31
 
32
  print_current_time( "Task_1: ", "" );
33
 
34
  puts( "Task_1: pthread_kill - SIGUSR2 to Init" );
35
  status = pthread_kill( Init_id, SIGUSR2 );
36
  assert( !status );
37
 
38
  pthread_exit( NULL );
39
 
40
     /* switch to Init */
41
 
42
  return NULL; /* just so the compiler thinks we returned something */
43
}
44
 
45
void *Task_2(
46
  void *argument
47
)
48
{
49
  int status;
50
 
51
  /* send SIGUSR1 to Init which is waiting on SIGUSR1 */
52
 
53
  print_current_time( "Task_2: ", "" );
54
 
55
  puts( "Task_1: pthread_kill - SIGUSR1 to Init" );
56
  status = pthread_kill( Init_id, SIGUSR1 );
57
  assert( !status );
58
 
59
  pthread_exit( NULL );
60
 
61
     /* switch to Init */
62
 
63
  return NULL; /* just so the compiler thinks we returned something */
64
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.