mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-10-03 15:38:36 +00:00
lock goodbye_cruel_world in threading mode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user