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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [cris/] [c/] [sig9.c] - Blame information for rev 834

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

Line No. Rev Author Line
1 227 jeremybenn
/* Check that TRT happens at an non-abort ignored signal, more than one thread.
2
#notarget: cris*-*-elf
3
#cc: additional_flags=-pthread
4
*/
5
 
6
#include <stdlib.h>
7
#include <stddef.h>
8
#include <stdio.h>
9
#include <unistd.h>
10
#include <pthread.h>
11
#include <sys/types.h>
12
#include <signal.h>
13
 
14
static void *
15
process (void *arg)
16
{
17
  int i;
18
  for (i = 0; i < 100; i++)
19
    sched_yield ();
20
  return NULL;
21
}
22
 
23
int main (void)
24
{
25
  pthread_t th_a;
26
  int retcode;
27
  void *retval;
28
  signal (SIGALRM, SIG_IGN);
29
  if (pthread_create (&th_a, NULL, process, (void *) "a") == 0)
30
    kill (getpid (), SIGALRM);
31
  retcode = pthread_join (th_a, &retval);
32
  if (retcode != 0 || retval != NULL)
33
    abort ();
34
  printf ("pass\n");
35
  exit (0);
36
}

powered by: WebSVN 2.1.0

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