Lines Matching refs:ends

557     _channelends *ends = PyMem_NEW(_channelends, 1);
558 if (ends== NULL) {
561 ends->numsendopen = 0;
562 ends->numrecvopen = 0;
563 ends->send = NULL;
564 ends->recv = NULL;
565 return ends;
569 _channelends_clear(_channelends *ends)
571 _channelend_free_all(ends->send);
572 ends->send = NULL;
573 ends->numsendopen = 0;
575 _channelend_free_all(ends->recv);
576 ends->recv = NULL;
577 ends->numrecvopen = 0;
581 _channelends_free(_channelends *ends)
583 _channelends_clear(ends);
584 PyMem_Free(ends);
588 _channelends_add(_channelends *ends, _channelend *prev, int64_t interp,
598 ends->send = end;
601 ends->recv = end;
608 ends->numsendopen += 1;
611 ends->numrecvopen += 1;
617 _channelends_associate(_channelends *ends, int64_t interp, int send)
620 _channelend *end = _channelend_find(send ? ends->send : ends->recv,
630 if (_channelends_add(ends, prev, interp, send) == NULL) {
637 _channelends_is_open(_channelends *ends)
639 if (ends->numsendopen != 0 || ends->numrecvopen != 0) {
642 if (ends->send == NULL && ends->recv == NULL) {
649 _channelends_close_end(_channelends *ends, _channelend *end, int send)
653 ends->numsendopen -= 1;
656 ends->numrecvopen -= 1;
661 _channelends_close_interpreter(_channelends *ends, int64_t interp, int which)
666 end = _channelend_find(ends->send, interp, &prev);
669 end = _channelends_add(ends, prev, interp, 1);
674 _channelends_close_end(ends, end, 1);
677 end = _channelend_find(ends->recv, interp, &prev);
680 end = _channelends_add(ends, prev, interp, 0);
685 _channelends_close_end(ends, end, 0);
691 _channelends_close_all(_channelends *ends, int which, int force)
693 // XXX Handle the ends.
698 for (end = ends->send; end != NULL; end = end->next) {
699 _channelends_close_end(ends, end, 1);
703 for (end = ends->recv; end != NULL; end = end->next) {
704 _channelends_close_end(ends, end, 0);
718 _channelends *ends;
742 chan->ends = _channelends_new();
743 if (chan->ends == NULL) {
759 _channelends_free(chan->ends);
777 if (_channelends_associate(chan->ends, interp, 1) != 0) {
801 if (_channelends_associate(chan->ends, interp, 0) != 0) {
829 if (_channelends_close_interpreter(chan->ends, interp, end) != 0) {
832 chan->open = _channelends_is_open(chan->ends);
861 _channelends_close_all(chan->ends, end, force);
1382 // Close one or both of the two ends.
1406 _channelend *end = _channelend_find(send ? chan->ends->send : chan->ends->recv,
2483 ends are immediately closed. Otherwise, if 'force' is True then\n\
2484 all queued items are released and both ends are immediately\n\
2536 (bool) may be used to indicate the ends to close. By default both\n\
2537 ends are closed. Closing an already closed end is a noop.");