From 5b7887fc06ac0f9ec8318671cf2019cd1adacfc6 Mon Sep 17 00:00:00 2001 From: Speedclocker Date: Mon, 11 Mar 2019 01:37:40 +0100 Subject: [PATCH] Début thread --- Sioux/.sioux.c.swp | Bin 0 -> 12288 bytes Threads/threadsSocket.c | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-) create mode 100644 Sioux/.sioux.c.swp create mode 100644 Threads/threadsSocket.c diff --git a/Sioux/.sioux.c.swp b/Sioux/.sioux.c.swp new file mode 100644 index 0000000..6e2bb11 Binary files /dev/null and b/Sioux/.sioux.c.swp differ diff --git a/Threads/threadsSocket.c b/Threads/threadsSocket.c new file mode 100644 index 0000000..29a1931 --- /dev/null +++ b/Threads/threadsSocket.c @@ -0,0 +1,21 @@ +#include +#include +#include + + +int lanceThread(void(* fonction) (void *), void* arg, int size) +{ + pthread_t thr_id; + + if(pthread_create(&thr_id, NULL, fonction, arg)!=0) { fprintf(stderr, "Le thread n'a pas pu être créé.\n"); return -1; } + + pthread_detach(thr_id); + + + +} + +int main(void) +{ + +} -- libgit2 0.21.2