From 11b2e4b4305e35e2d7fecb1352ab0825681917ea Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Wed, 11 May 2011 17:08:02 +0200 Subject: [PATCH] lock goodbye_cruel_world in threading mode --- utils.c | 2 +- uwsgi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils.c b/utils.c index 4ee0b85c..8b29bd81 100644 --- a/utils.c +++ b/utils.c @@ -737,7 +737,7 @@ int wsgi_req_accept(struct wsgi_request *wsgi_req) { if (fcntl(wsgi_req->poll.fd, F_SETFL, arg) < 0) { uwsgi_error("fcntl()"); #ifdef UWSGI_THREADING - if (uwsgi.threads > 1) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &ret); + if (uwsgi.threads > 1) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &ret); #endif return -1; } diff --git a/uwsgi.c b/uwsgi.c index de36acd4..3f41f735 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -345,7 +345,7 @@ void goodbye_cruel_world() { // in threading mode we need to use the cancel pthread subsystem #ifdef UWSGI_THREADING if (uwsgi.threads > 1 && !uwsgi.to_hell) { - //pthread_mutex_lock(&uwsgi.six_feet_under_lock); + pthread_mutex_lock(&uwsgi.six_feet_under_lock); int i, ret; for(i=0;ithread_id, pthread_self())) { @@ -363,7 +363,7 @@ void goodbye_cruel_world() { } } - //pthread_mutex_unlock(&uwsgi.six_feet_under_lock); + pthread_mutex_unlock(&uwsgi.six_feet_under_lock); } #endif