Lines Matching refs:cid
1000 int64_t cid = -1; in _channels_add() local
1019 cid = id; in _channels_add()
1022 return cid; in _channels_add()
1029 _channels_close(_channels *channels, int64_t cid, _PyChannelState **pchan, in _channels_close() argument
1038 _channelref *ref = _channelref_find(channels->head, cid, NULL); in _channels_close()
1040 PyErr_Format(ChannelNotFoundError, "channel %" PRId64 " not found", cid); in _channels_close()
1045 PyErr_Format(ChannelClosedError, "channel %" PRId64 " closed", cid); in _channels_close()
1049 PyErr_Format(ChannelClosedError, "channel %" PRId64 " closed", cid); in _channels_close()
1058 "channel %" PRId64 " closed", cid); in _channels_close()
1391 _channel_is_associated(_channels *channels, int64_t cid, int64_t interp, in _channel_is_associated() argument
1394 _PyChannelState *chan = _channels_lookup(channels, cid, NULL); in _channel_is_associated()
1398 PyErr_Format(ChannelClosedError, "channel %" PRId64 " closed", cid); in _channel_is_associated()
1423 int64_t cid; in channel_id_converter() local
1425 cid = ((channelid *)arg)->id; in channel_id_converter()
1428 cid = PyLong_AsLongLong(arg); in channel_id_converter()
1429 if (cid == -1 && PyErr_Occurred()) { in channel_id_converter()
1432 if (cid < 0) { in channel_id_converter()
1444 *(int64_t *)ptr = cid; in channel_id_converter()
1449 newchannelid(PyTypeObject *cls, int64_t cid, int end, _channels *channels, in newchannelid() argument
1456 self->id = cid; in newchannelid()
1461 if (_channels_add_id_object(channels, cid) != 0) { in newchannelid()
1480 int64_t cid; in channelid_new() local
1487 channel_id_converter, &cid, &send, &recv, &force, &resolve)) in channelid_new()
1507 return (PyObject *)newchannelid(cls, cid, end, _global_channels(), in channelid_new()
1514 int64_t cid = ((channelid *)v)->id; in channelid_dealloc() local
1518 _channels_drop_id_object(channels, cid); in channelid_dealloc()
1527 channelid *cid = (channelid *)self; in channelid_repr() local
1529 if (cid->end == CHANNEL_SEND) { in channelid_repr()
1532 else if (cid->end == CHANNEL_RECV) { in channelid_repr()
1538 return PyUnicode_FromFormat(fmt, name, cid->id); in channelid_repr()
1544 channelid *cid = (channelid *)self; in channelid_str() local
1545 return PyUnicode_FromFormat("%" PRId64 "", cid->id); in channelid_str()
1551 channelid *cid = (channelid *)self; in channelid_int() local
1552 return PyLong_FromLongLong(cid->id); in channelid_int()
1598 channelid *cid = (channelid *)self; in channelid_hash() local
1599 PyObject *id = PyLong_FromLongLong(cid->id); in channelid_hash()
1619 channelid *cid = (channelid *)self; in channelid_richcompare() local
1623 equal = (cid->end == othercid->end) && (cid->id == othercid->id); in channelid_richcompare()
1632 equal = !overflow && (othercid >= 0) && (cid->id == othercid); in channelid_richcompare()
1635 PyObject *pyid = PyLong_FromLongLong(cid->id); in channelid_richcompare()
1654 _channel_from_cid(PyObject *cid, int end) in _channel_from_cid() argument
1671 PyObject *chan = PyObject_CallFunctionObjArgs(cls, cid, NULL); in _channel_from_cid()
1690 PyObject *cid = (PyObject *)newchannelid(&ChannelIDtype, xid->id, xid->end, in _channelid_from_xid() local
1693 return cid; in _channelid_from_xid()
1696 return cid; in _channelid_from_xid()
1700 PyObject *chan = _channel_from_cid(cid, xid->end); in _channelid_from_xid()
1703 return cid; in _channelid_from_xid()
1705 Py_DECREF(cid); in _channelid_from_xid()
1732 channelid *cid = (channelid *)self; in channelid_end() local
1734 return (PyObject *)newchannelid(Py_TYPE(self), cid->id, *(int *)end, in channelid_end()
1735 cid->channels, force, cid->resolve); in channelid_end()
1738 if (cid->end == CHANNEL_SEND) { in channelid_end()
1741 if (cid->end == CHANNEL_RECV) { in channelid_end()
2273 int64_t cid = _channel_create(&_globals.channels); in channel_create() local
2274 if (cid < 0) { in channel_create()
2277 PyObject *id = (PyObject *)newchannelid(&ChannelIDtype, cid, 0, in channel_create()
2280 if (_channel_destroy(&_globals.channels, cid) != 0) { in channel_create()
2298 int64_t cid; in channel_destroy() local
2300 channel_id_converter, &cid)) { in channel_destroy()
2304 if (_channel_destroy(&_globals.channels, cid) != 0) { in channel_destroy()
2357 int64_t cid; /* Channel ID */ in channel_list_interpreters() local
2365 kwlist, channel_id_converter, &cid, &send)) { in channel_list_interpreters()
2378 int res = _channel_is_associated(&_globals.channels, cid, id, send); in channel_list_interpreters()
2419 int64_t cid; in channel_send() local
2422 channel_id_converter, &cid, &obj)) { in channel_send()
2426 if (_channel_send(&_globals.channels, cid, obj) != 0) { in channel_send()
2441 int64_t cid; in channel_recv() local
2444 channel_id_converter, &cid, &dflt)) { in channel_recv()
2449 PyObject *obj = _channel_recv(&_globals.channels, cid); in channel_recv()
2459 PyErr_Format(ChannelEmptyError, "channel %" PRId64 " is empty", cid); in channel_recv()
2476 int64_t cid; in channel_close() local
2482 channel_id_converter, &cid, &send, &recv, &force)) { in channel_close()
2486 if (_channel_close(&_globals.channels, cid, send-recv, force) != 0) { in channel_close()
2524 int64_t cid; in channel_release() local
2530 channel_id_converter, &cid, &send, &recv, &force)) { in channel_release()
2541 if (_channel_drop(&_globals.channels, cid, send, recv) != 0) { in channel_release()