ltrace/tests/Sanity/random-apps/thread-test2.c
Václav Kadlčík 0554fda54f Import RHEL's test Sanity/random-apps
Note than several sub-tests (apps) had to be removed as unsuitable
for publishing.
2021-08-17 16:31:24 +00:00

35 lines
763 B
C

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <signal.h>
#define THREAD_NUM 32
void *thread_function (void *);
int main (int argc, char *argv[])
{
int i =0, x = 0;
int res = 0;
pthread_t a_thread[THREAD_NUM];
void *thread_result;
for (i = 0; i < THREAD_NUM; i++) {
res = pthread_create (&a_thread[i], NULL, thread_function, (void *)0);
if (res != 0) {
printf("Thread create failed\n");
return (10);
}
}
raise(SIGABRT);
return (0);
}
void *thread_function (void *arg)
{
sleep(1);
printf("Thread TEST\n");
}