From a42b1ca51220fdb5d3670457ef62091219a03f51 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 28 Feb 2010 19:54:00 +0100 Subject: [PATCH] yhttpd: try to fix shutdown problems, probably directfb related --- src/nhttpd/yhttpd.cpp | 1 + src/nhttpd/yhttpd_core/ywebserver.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/nhttpd/yhttpd.cpp b/src/nhttpd/yhttpd.cpp index 17997aaf5..bac6a74d8 100644 --- a/src/nhttpd/yhttpd.cpp +++ b/src/nhttpd/yhttpd.cpp @@ -107,6 +107,7 @@ void yhttpd_reload_config() { #ifndef Y_CONFIG_BUILD_AS_DAEMON void * nhttpd_main_thread(void *) { pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); aprintf("Webserver %s tid %ld\n", WEBSERVERNAME, syscall(__NR_gettid)); yhttpd = new Cyhttpd(); //CLogging::getInstance()->setDebug(true); diff --git a/src/nhttpd/yhttpd_core/ywebserver.cpp b/src/nhttpd/yhttpd_core/ywebserver.cpp index 601b966a3..2b9c1e503 100644 --- a/src/nhttpd/yhttpd_core/ywebserver.cpp +++ b/src/nhttpd/yhttpd_core/ywebserver.cpp @@ -218,6 +218,8 @@ bool CWebserver::run(void) { CySocket *newConnectionSock; if (!(newConnectionSock = listenSocket.accept())) //Now: Blocking wait { + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + pthread_testcancel(); dperror("Socket accept error. Continue.\n"); continue; }