URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 24 |
Rev 33 |
/* Check that TRT happens at an abort (3) call, more than one thread.
|
/* Check that TRT happens at an abort (3) call, more than one thread.
|
#notarget: cris*-*-elf
|
#notarget: cris*-*-elf
|
#cc: additional_flags=-pthread
|
#cc: additional_flags=-pthread
|
#xerror:
|
#xerror:
|
#output: Exiting pid 42 due to signal 6\n
|
#output: Exiting pid 42 due to signal 6\n
|
#output: program stopped with signal 6.\n
|
#output: program stopped with signal 6.\n
|
*/
|
*/
|
|
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <stddef.h>
|
#include <stddef.h>
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <unistd.h>
|
#include <unistd.h>
|
#include <pthread.h>
|
#include <pthread.h>
|
|
|
static void *
|
static void *
|
process (void *arg)
|
process (void *arg)
|
{
|
{
|
while (1)
|
while (1)
|
sched_yield ();
|
sched_yield ();
|
return NULL;
|
return NULL;
|
}
|
}
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
pthread_t th_a;
|
pthread_t th_a;
|
if (pthread_create (&th_a, NULL, process, (void *) "a") == 0)
|
if (pthread_create (&th_a, NULL, process, (void *) "a") == 0)
|
abort ();
|
abort ();
|
printf ("xyzzy\n");
|
printf ("xyzzy\n");
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.