From acf4c6bddb02b8b046bbabec69ff3d0bbe0f76f8 Mon Sep 17 00:00:00 2001 From: Harvie Date: Wed, 9 Jun 2010 02:50:00 +0200 Subject: [PATCH] added pthread example --- c/pthread.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 c/pthread.c 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); +} -- 2.30.2