mirror of https://git.kore.io/kore.git
hide kore.coroname() behind PYTHON_CORO_TRACE.
This commit is contained in:
parent
019006620d
commit
c1653a5254
|
@ -21,7 +21,9 @@ struct python_coro {
|
|||
u_int64_t id;
|
||||
int state;
|
||||
PyObject *obj;
|
||||
#if defined(PYTHON_CORO_TRACE)
|
||||
char *name;
|
||||
#endif
|
||||
PyObject *result;
|
||||
struct pysocket_op *sockop;
|
||||
struct pygather_op *gatherop;
|
||||
|
|
|
@ -333,7 +333,9 @@ kore_python_coro_delete(void *obj)
|
|||
else
|
||||
TAILQ_REMOVE(&coro_suspended, coro, list);
|
||||
|
||||
#if defined(PYTHON_CORO_TRACE)
|
||||
kore_free(coro->name);
|
||||
#endif
|
||||
Py_XDECREF(coro->result);
|
||||
|
||||
kore_pool_put(&coro_pool, coro);
|
||||
|
@ -555,7 +557,9 @@ python_coro_create(PyObject *obj, struct http_request *req)
|
|||
coro = kore_pool_get(&coro_pool);
|
||||
coro_count++;
|
||||
|
||||
#if defined(PYTHON_CORO_TRACE)
|
||||
coro->name = NULL;
|
||||
#endif
|
||||
coro->result = NULL;
|
||||
coro->sockop = NULL;
|
||||
coro->gatherop = NULL;
|
||||
|
@ -1528,6 +1532,7 @@ python_kore_shutdown(PyObject *self, PyObject *args)
|
|||
static PyObject *
|
||||
python_kore_coroname(PyObject *self, PyObject *args)
|
||||
{
|
||||
#if defined(PYTHON_CORO_TRACE)
|
||||
const char *name;
|
||||
|
||||
if (coro_running == NULL) {
|
||||
|
@ -1541,7 +1546,7 @@ python_kore_coroname(PyObject *self, PyObject *args)
|
|||
|
||||
kore_free(coro_running->name);
|
||||
coro_running->name = kore_strdup(name);
|
||||
|
||||
#endif
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue