summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-10-24 00:39:45 +0200
committerLennart Poettering <lennart@poettering.net>2008-10-24 00:39:45 +0200
commit30aac1c9c874f0fd30aa86f27c5dd04376774eeb (patch)
tree1688ccd221566d210b03011efc66d26655fb3af4
parent3aa298c6e6426c43f9a48e115885b91b29e411fe (diff)
drop pthread cancelling code since it is problematic and completely redundant
-rw-r--r--libasyncns/asyncns.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/libasyncns/asyncns.c b/libasyncns/asyncns.c
index d010b66..d707ac9 100644
--- a/libasyncns/asyncns.c
+++ b/libasyncns/asyncns.c
@@ -707,9 +707,6 @@ static void* thread_worker(void *p) {
out_fd = fds[RESPONSE_SEND_FD];
free(p);
- pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
-
/* No signals in this thread please */
sigfillset(&fullset);
pthread_sigmask(SIG_BLOCK, &fullset, NULL);
@@ -721,17 +718,8 @@ static void* thread_worker(void *p) {
if ((length = recv(in_fd, buf, sizeof(buf), 0)) <= 0)
break;
- /* We cannot cancel the thread while it is in on of the name
- * resolver functions, because the cleanup might not happen
- * properly. To work around this we temporarily disable
- * cancellation. The request handling code will eventually
- * terminate, and hence we should be safe. */
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
-
if (handle_request(out_fd, buf, (size_t) length) < 0)
break;
-
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
}
send_died(out_fd);
@@ -859,7 +847,6 @@ void asyncns_free(asyncns_t *asyncns) {
kill(asyncns->workers[p], SIGTERM);
waitpid(asyncns->workers[p], NULL, 0);
#else
- pthread_cancel(asyncns->workers[p]);
pthread_detach(asyncns->workers[p]);
/* We don't join the thread here because there is no clean way