| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_RRDSET_SLOTS_H |
| 4 | #define NETDATA_RRDSET_SLOTS_H |
| 5 | |
| 6 | #include "rrd.h" |
| 7 | |
| 8 | void rrdset_stream_send_chart_slot_assign(RRDSET *st); |
| 9 | void rrdset_stream_send_chart_slot_release(RRDSET *st); |
| 10 | |
| 11 | // rrdset_pluginsd_receive_unslot: Releases dimension references but keeps the array. |
| 12 | // Safe to call from the collector thread itself (detected via collector_tid == gettid_cached()) |
| 13 | // or when the collector is fully stopped. |
| 14 | void rrdset_pluginsd_receive_unslot(RRDSET *st); |
| 15 | |
| 16 | // rrdset_pluginsd_receive_unslot_and_cleanup: Full cleanup - releases dimension references |
| 17 | // AND frees the array. Must only be called when the collector is FULLY STOPPED on the chart. |
| 18 | // The collector_tid check is a safety mechanism (fires internal_fatal in debug builds). |
| 19 | void rrdset_pluginsd_receive_unslot_and_cleanup(RRDSET *st); |
| 20 | |
| 21 | void rrdset_pluginsd_receive_slots_initialize(RRDSET *st); |
| 22 | |
| 23 | // Stress test for PRD_ARRAY lifecycle separation - run with -W prd-array-stress |
| 24 | int prd_array_stress_test(void); |
| 25 | |
| 26 | #endif //NETDATA_RRDSET_SLOTS_H |