yhttpd: try to fix shutdown problems, probably directfb related

This commit is contained in:
Stefan Seyfried
2010-02-28 19:54:00 +01:00
parent 9142326043
commit a42b1ca512
2 changed files with 3 additions and 0 deletions

View File

@@ -107,6 +107,7 @@ void yhttpd_reload_config() {
#ifndef Y_CONFIG_BUILD_AS_DAEMON #ifndef Y_CONFIG_BUILD_AS_DAEMON
void * nhttpd_main_thread(void *) { void * nhttpd_main_thread(void *) {
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
aprintf("Webserver %s tid %ld\n", WEBSERVERNAME, syscall(__NR_gettid)); aprintf("Webserver %s tid %ld\n", WEBSERVERNAME, syscall(__NR_gettid));
yhttpd = new Cyhttpd(); yhttpd = new Cyhttpd();
//CLogging::getInstance()->setDebug(true); //CLogging::getInstance()->setDebug(true);

View File

@@ -218,6 +218,8 @@ bool CWebserver::run(void) {
CySocket *newConnectionSock; CySocket *newConnectionSock;
if (!(newConnectionSock = listenSocket.accept())) //Now: Blocking wait if (!(newConnectionSock = listenSocket.accept())) //Now: Blocking wait
{ {
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_testcancel();
dperror("Socket accept error. Continue.\n"); dperror("Socket accept error. Continue.\n");
continue; continue;
} }