diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-06-03 17:04:10 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-06-03 17:04:10 +0200 |
commit | ecbe89613c7c0421f8f09267ad057dcbc71b087c (patch) | |
tree | 46c3a6ca5271a3e81b8801a27af7e3e31f0215f0 /src/resolve.c | |
parent | b506a1cb52337b94c56dd044331669ebb9723246 (diff) | |
download | fastd-ecbe89613c7c0421f8f09267ad057dcbc71b087c.tar fastd-ecbe89613c7c0421f8f09267ad057dcbc71b087c.zip |
Create threads in detached state
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/resolve.c b/src/resolve.c index b37cef6..1020253 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -34,7 +34,6 @@ #include "async.h" #include <netdb.h> -#include <pthread.h> /** The argument given to the resolver thread */ @@ -134,7 +133,7 @@ void fastd_resolve_peer(fastd_peer_t *peer, fastd_remote_t *remote) { arg->constraints = remote->config->address; pthread_t thread; - if ((errno = pthread_create(&thread, NULL, resolve_peer, arg)) != 0) { + if ((errno = pthread_create(&thread, &ctx.detached_thread, resolve_peer, arg)) != 0) { pr_error_errno("unable to create resolver thread"); free(arg->hostname); @@ -142,6 +141,4 @@ void fastd_resolve_peer(fastd_peer_t *peer, fastd_remote_t *remote) { return; } - - pthread_detach(thread); } |