lock goodbye_cruel_world in threading mode

This commit is contained in:
roberto@debian32
2011-05-11 17:08:02 +02:00
parent 11775532ee
commit 11b2e4b430
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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;
}
+2 -2
View File
@@ -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;i<uwsgi.threads;i++) {
if (!pthread_equal(uwsgi.core[i]->thread_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