Lines Matching refs:cid
1004 int64_t cid = -1;
1023 cid = id;
1026 return cid;
1033 _channels_close(_channels *channels, int64_t cid, _PyChannelState **pchan,
1042 _channelref *ref = _channelref_find(channels->head, cid, NULL);
1044 PyErr_Format(ChannelNotFoundError, "channel %" PRId64 " not found", cid);
1049 PyErr_Format(ChannelClosedError, "channel %" PRId64 " closed", cid);
1053 PyErr_Format(ChannelClosedError, "channel %" PRId64 " closed", cid);
1062 "channel %" PRId64 " closed", cid);
1395 _channel_is_associated(_channels *channels, int64_t cid, int64_t interp,
1398 _PyChannelState *chan = _channels_lookup(channels, cid, NULL);
1402 PyErr_Format(ChannelClosedError, "channel %" PRId64 " closed", cid);
1427 int64_t cid;
1429 cid = ((channelid *)arg)->id;
1432 cid = PyLong_AsLongLong(arg);
1433 if (cid == -1 && PyErr_Occurred()) {
1436 if (cid < 0) {
1448 *(int64_t *)ptr = cid;
1453 newchannelid(PyTypeObject *cls, int64_t cid, int end, _channels *channels,
1460 self->id = cid;
1465 if (_channels_add_id_object(channels, cid) != 0) {
1484 int64_t cid;
1491 channel_id_converter, &cid, &send, &recv, &force, &resolve))
1511 return (PyObject *)newchannelid(cls, cid, end, _global_channels(),
1518 int64_t cid = ((channelid *)v)->id;
1522 _channels_drop_id_object(channels, cid);
1531 channelid *cid = (channelid *)self;
1533 if (cid->end == CHANNEL_SEND) {
1536 else if (cid->end == CHANNEL_RECV) {
1542 return PyUnicode_FromFormat(fmt, name, cid->id);
1548 channelid *cid = (channelid *)self;
1549 return PyUnicode_FromFormat("%" PRId64 "", cid->id);
1555 channelid *cid = (channelid *)self;
1556 return PyLong_FromLongLong(cid->id);
1602 channelid *cid = (channelid *)self;
1603 PyObject *id = PyLong_FromLongLong(cid->id);
1623 channelid *cid = (channelid *)self;
1627 equal = (cid->end == othercid->end) && (cid->id == othercid->id);
1636 equal = !overflow && (othercid >= 0) && (cid->id == othercid);
1639 PyObject *pyid = PyLong_FromLongLong(cid->id);
1658 _channel_from_cid(PyObject *cid, int end)
1675 PyObject *chan = PyObject_CallFunctionObjArgs(cls, cid, NULL);
1694 PyObject *cid = (PyObject *)newchannelid(&ChannelIDtype, xid->id, xid->end,
1697 return cid;
1700 return cid;
1704 PyObject *chan = _channel_from_cid(cid, xid->end);
1707 return cid;
1709 Py_DECREF(cid);
1736 channelid *cid = (channelid *)self;
1738 return (PyObject *)newchannelid(Py_TYPE(self), cid->id, *(int *)end,
1739 cid->channels, force, cid->resolve);
1742 if (cid->end == CHANNEL_SEND) {
1745 if (cid->end == CHANNEL_RECV) {
2258 int64_t cid = _channel_create(&_globals.channels);
2259 if (cid < 0) {
2262 PyObject *id = (PyObject *)newchannelid(&ChannelIDtype, cid, 0,
2265 if (_channel_destroy(&_globals.channels, cid) != 0) {
2275 "channel_create() -> cid\n\
2282 static char *kwlist[] = {"cid", NULL};
2283 int64_t cid;
2285 channel_id_converter, &cid)) {
2289 if (_channel_destroy(&_globals.channels, cid) != 0) {
2296 "channel_destroy(cid)\n\
2334 "channel_list_all() -> [cid]\n\
2341 static char *kwlist[] = {"cid", "send", NULL};
2342 int64_t cid; /* Channel ID */
2350 kwlist, channel_id_converter, &cid, &send)) {
2363 int res = _channel_is_associated(&_globals.channels, cid, id, send);
2392 "channel_list_interpreters(cid, *, send) -> [id]\n\
2403 static char *kwlist[] = {"cid", "obj", NULL};
2404 int64_t cid;
2407 channel_id_converter, &cid, &obj)) {
2411 if (_channel_send(&_globals.channels, cid, obj) != 0) {
2418 "channel_send(cid, obj)\n\
2425 static char *kwlist[] = {"cid", "default", NULL};
2426 int64_t cid;
2429 channel_id_converter, &cid, &dflt)) {
2434 PyObject *obj = _channel_recv(&_globals.channels, cid);
2444 PyErr_Format(ChannelEmptyError, "channel %" PRId64 " is empty", cid);
2450 "channel_recv(cid, [default]) -> obj\n\
2460 static char *kwlist[] = {"cid", "send", "recv", "force", NULL};
2461 int64_t cid;
2467 channel_id_converter, &cid, &send, &recv, &force)) {
2471 if (_channel_close(&_globals.channels, cid, send-recv, force) != 0) {
2478 "channel_close(cid, *, send=None, recv=None, force=False)\n\
2508 static char *kwlist[] = {"cid", "send", "recv", "force", NULL};
2509 int64_t cid;
2515 channel_id_converter, &cid, &send, &recv, &force)) {
2526 if (_channel_drop(&_globals.channels, cid, send, recv) != 0) {
2533 "channel_release(cid, *, send=None, recv=None, force=True)\n\