From: Harvie Date: Wed, 9 Jun 2010 00:50:00 +0000 (+0200) Subject: added pthread example X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=acf4c6bddb02b8b046bbabec69ff3d0bbe0f76f8;p=mirrors%2FPrograms.git added pthread example --- diff --git a/c/pthread.c b/c/pthread.c new file mode 100644 index 0000000..74ab4bd --- /dev/null +++ b/c/pthread.c @@ -0,0 +1,15 @@ +#include +#include + +void *go(void *args) { + while(1) { + puts("lol!"); + } +} + +int main() { + pthread_t t; + //pthread_create(&t, NULL, go, NULL); + pthread_create(&t, NULL, puts, "hello!"); + sleep(1); +}