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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [tests/] [psxtests/] [psx03/] [task.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  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
 *  task.c,v 1.6 1999/11/17 17:51:31 joel 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.