MCPcopy Create free account
hub / github.com/apache/cloudberry / shareinput_reader_notifydone

Function shareinput_reader_notifydone

src/backend/executor/nodeShareInputScan.c:1005–1017  ·  view source on GitHub ↗

* shareinput_reader_notifydone * * Called by the reader (consumer) to notify the writer (producer) that * it is done reading tuples from disk. * * This is a non-blocking operation. */

Source from the content-addressed store, hash-verified

1003 * This is a non-blocking operation.
1004 */
1005static void
1006shareinput_reader_notifydone(shareinput_Xslice_reference *ref, int nconsumers)
1007{
1008 shareinput_Xslice_state *state = ref->xslice_state;
1009 int ndone = pg_atomic_add_fetch_u32(&state->ndone, 1);
1010
1011 /* If we were the last consumer, wake up the producer. */
1012 if (ndone >= nconsumers)
1013 ConditionVariableBroadcast(&state->ready_done_cv);
1014
1015 elog((Debug_shareinput_xslice ? LOG : DEBUG1), "SISC READER (shareid=%d, slice=%d): wrote notify_done",
1016 ref->share_id, currentSliceId);
1017}
1018
1019/*
1020 * shareinput_writer_waitdone

Callers 2

ExecEndShareInputScanFunction · 0.85

Calls 2

pg_atomic_add_fetch_u32Function · 0.85

Tested by

no test coverage detected