Skip to content
Prev Previous commit
Next Next commit
Add _channelitem.received.
  • Loading branch information
ericsnowcurrently committed Oct 16, 2023
commit 38bf6a153e5ce89030eb9fcee20c9a0ed3a5ef39
3 changes: 3 additions & 0 deletions Modules/_xxinterpchannelsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ struct _channelitem;
typedef struct _channelitem {
_PyCrossInterpreterData *data;
PyThread_type_lock recv_mutex;
int received;
struct _channelitem *next;
} _channelitem;

Expand All @@ -601,6 +602,7 @@ _channelitem_new(void)
return NULL;
}
item->data = NULL;
item->received = 0;
item->next = NULL;
return item;
}
Expand Down Expand Up @@ -636,6 +638,7 @@ _channelitem_free_all(_channelitem *item)
static _PyCrossInterpreterData *
_channelitem_popped(_channelitem *item, PyThread_type_lock *recv_mutex)
{
item->received = 1;
_PyCrossInterpreterData *data = item->data;
item->data = NULL;
*recv_mutex = item->recv_mutex;
Expand Down