Hailin
2013-03-28 10:34:22 +08:00
commit a5ec64177d
55 changed files with 6183 additions and 0 deletions

28
hello.c Normal file
View File

@@ -0,0 +1,28 @@
/*
* hello.c
*
* Create a very simple thread that says "Hello world", just
* because it has to be here.
*/
#include <pthread.h>
#include "errors.h"
void *hello_world (void *arg)
{
printf ("Hello world\n");
return NULL;
}
int main (int argc, char *argv[])
{
pthread_t hello_id;
int status;
status = pthread_create (&hello_id, NULL, hello_world, NULL);
if (status != 0)
err_abort (status, "Create thread");
status = pthread_join (hello_id, NULL);
if (status != 0)
err_abort (status, "Join thread");
return 0;
}