diff --git a/plugins/python/pump_subhandler.c b/plugins/python/pump_subhandler.c index e7eadfed..80af56c8 100644 --- a/plugins/python/pump_subhandler.c +++ b/plugins/python/pump_subhandler.c @@ -185,8 +185,6 @@ int uwsgi_response_subhandler_pump(struct wsgi_request *wsgi_req) { struct http_status_codes *http_sc; char sc[4]; - UWSGI_GET_GIL - // ok its a yield if (!wsgi_req->async_placeholder) { if (PyDict_Check((PyObject *)wsgi_req->async_result)) { @@ -339,7 +337,6 @@ int uwsgi_response_subhandler_pump(struct wsgi_request *wsgi_req) { } #ifdef UWSGI_ASYNC if (uwsgi.async > 1) { - UWSGI_RELEASE_GIL return UWSGI_AGAIN; } #endif @@ -371,7 +368,6 @@ int uwsgi_response_subhandler_pump(struct wsgi_request *wsgi_req) { Py_DECREF(pychunk); - UWSGI_RELEASE_GIL return UWSGI_AGAIN; clear: @@ -380,7 +376,6 @@ clear: Py_DECREF((PyObject *)wsgi_req->async_result); PyErr_Clear(); - UWSGI_RELEASE_GIL return UWSGI_OK; } diff --git a/plugins/python/web3_subhandler.c b/plugins/python/web3_subhandler.c index 487e3df6..5f24735b 100644 --- a/plugins/python/web3_subhandler.c +++ b/plugins/python/web3_subhandler.c @@ -136,8 +136,6 @@ int uwsgi_response_subhandler_web3(struct wsgi_request *wsgi_req) { PyObject *pychunk; ssize_t wsize; - UWSGI_GET_GIL - // ok its a yield if (!wsgi_req->async_placeholder) { if (PyTuple_Check((PyObject *)wsgi_req->async_result)) { @@ -189,7 +187,6 @@ int uwsgi_response_subhandler_web3(struct wsgi_request *wsgi_req) { } #ifdef UWSGI_ASYNC if (uwsgi.async > 1) { - UWSGI_RELEASE_GIL return UWSGI_AGAIN; } #endif @@ -221,7 +218,6 @@ int uwsgi_response_subhandler_web3(struct wsgi_request *wsgi_req) { Py_DECREF(pychunk); - UWSGI_RELEASE_GIL return UWSGI_AGAIN; clear: @@ -230,7 +226,6 @@ clear: Py_DECREF((PyObject *)wsgi_req->async_result); PyErr_Clear(); - UWSGI_RELEASE_GIL return UWSGI_OK; } diff --git a/plugins/python/wsgi_handlers.c b/plugins/python/wsgi_handlers.c index 7668e796..fa4a6a46 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -445,8 +445,6 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { wsgi_req->async_result = wi->request_subhandler(wsgi_req, wi); - UWSGI_RELEASE_GIL - if (wsgi_req->async_result) { @@ -502,13 +500,13 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { } // this object must be freed/cleared always - UWSGI_GET_GIL if (wsgi_req->async_input) { Py_DECREF((PyObject *)wsgi_req->async_input); } if (wsgi_req->async_environ) { PyDict_Clear(wsgi_req->async_environ); } + UWSGI_RELEASE_GIL clear: diff --git a/plugins/python/wsgi_subhandler.c b/plugins/python/wsgi_subhandler.c index 2ef7792d..4f31df50 100644 --- a/plugins/python/wsgi_subhandler.c +++ b/plugins/python/wsgi_subhandler.c @@ -170,8 +170,6 @@ int uwsgi_response_subhandler_wsgi(struct wsgi_request *wsgi_req) { ssize_t sf_len = 0; #endif - UWSGI_GET_GIL - // return or yield ? if (PyString_Check((PyObject *)wsgi_req->async_result)) { if ((wsize = wsgi_req->socket->proto_write(wsgi_req, PyString_AsString(wsgi_req->async_result), PyString_Size(wsgi_req->async_result))) < 0) { @@ -195,7 +193,6 @@ int uwsgi_response_subhandler_wsgi(struct wsgi_request *wsgi_req) { #ifdef UWSGI_ASYNC if (uwsgi.async > 1) { if (wsgi_req->response_size < wsgi_req->sendfile_fd_size) { - UWSGI_RELEASE_GIL return UWSGI_AGAIN; } } @@ -213,7 +210,6 @@ int uwsgi_response_subhandler_wsgi(struct wsgi_request *wsgi_req) { } #ifdef UWSGI_ASYNC if (uwsgi.async > 1) { - UWSGI_RELEASE_GIL return UWSGI_AGAIN; } #endif @@ -272,7 +268,6 @@ int uwsgi_response_subhandler_wsgi(struct wsgi_request *wsgi_req) { Py_DECREF(pychunk); - UWSGI_RELEASE_GIL return UWSGI_AGAIN; clear: @@ -285,7 +280,6 @@ clear2: Py_DECREF((PyObject *)wsgi_req->async_result); PyErr_Clear(); - UWSGI_RELEASE_GIL return UWSGI_OK; }