Skip to content

Commit

Permalink
Stackless issue python#265: fix PyChannel_Send_M
Browse files Browse the repository at this point in the history
The implementation was buggy. This affects only users of the C-API,
that call PyChannel_Send() and PyChannel_Send_nr() for calls from
outside of the interpreter (with no main-tasklet).
  • Loading branch information
Anselm Kruis authored and akruis committed Jun 10, 2021
1 parent 88271d3 commit 3f54aa5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Stackless/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ What's New in Stackless 3.X.X?

*Release date: 20XX-XX-XX*

- https://github.com/stackless-dev/stackless/issues/265
Fix C-API functions PyChannel_Send() and PyChannel_Send_nr() for calls from
outside of the interpreter (with no main-tasklet).

- https://github.com/stackless-dev/stackless/issues/264
Implement bpo-35134 for Stackless: move header Include/slp_tstate.h to
Include/cpython/slp_tstate.h.
Expand Down
5 changes: 4 additions & 1 deletion Stackless/module/channelobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,13 @@ the sender will be blocked. Otherwise, the receiver will\n\
be activated immediately, and the sender is put at the end of\n\
the runnables list.");

static PyObject *
impl_channel_send(PyChannelObject *self, PyObject *arg);

static PyObject *
PyChannel_Send_M(PyChannelObject *self, PyObject *arg)
{
PyMethodDef def = {"send", (PyCFunction)PyChannel_Send, METH_O};
PyMethodDef def = {"send", (PyCFunction)impl_channel_send, METH_O};
return PyStackless_CallCMethod_Main(&def, (PyObject *) self, "O", arg);
}

Expand Down

0 comments on commit 3f54aa5

Please sign in to comment.