mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-06 05:41:37 +00:00
23 lines
450 B
C
23 lines
450 B
C
/* a simple helloworld test, with pthread usage */
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <pthread.h>
|
|
#include <unistd.h>
|
|
|
|
void * print (void *arg)
|
|
{
|
|
printf("child: pid %d\n", getpid());
|
|
puts((char *) arg);
|
|
return NULL;
|
|
}
|
|
|
|
int main(int argc, char ** argv)
|
|
{
|
|
pthread_t thread;
|
|
printf("parent: pid %d\n", getpid());
|
|
pthread_create(&thread, NULL, print, "Hello World!");
|
|
pthread_join(thread, NULL);
|
|
return 0;
|
|
}
|