/* Popluate pipe descriptors for copying to/from waiters' buffers. 
This routine cycles through the waiters on the wait queue and creates a list of threads that will have data directly copied to / read from their buffers. This list helps us avoid double copying later. */
static size_t pipe_waiter_list_populate(sys_dlist_t *list, _wait_q_t *wait_q, size_t bytes_to_xfer)
/* Popluate pipe descriptors for copying to/from waiters' buffers. 
This routine cycles through the waiters on the wait queue and creates a list of threads that will have data directly copied to / read from their buffers. This list helps us avoid double copying later. */
static size_t pipe_waiter_list_populate(sys_dlist_t *list, _wait_q_t *wait_q, size_t bytes_to_xfer)
{
	struct waitq_walk_data walk_data;
	walk_data.list            = list;
	walk_data.bytes_requested = bytes_to_xfer;
	walk_data.bytes_available = 0;
	(void) z_sched_waitq_walk(wait_q, pipe_walk_op, &walk_data);
	return walk_data.bytes_available;
}