summaryrefslogtreecommitdiff
path: root/supervisor/background_callback.h
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-07-17 08:36:26 -0500
committerJeff Epler <jepler@gmail.com>2020-07-17 08:36:26 -0500
commita18a39210919a886d4efb4c52b85a309b3403abf (patch)
treead7b820c503bab7fafadfa00db1e89100a4ab2c6 /supervisor/background_callback.h
parent81105cb9ef68c4d88eab206f111af448440c8f30 (diff)
background_callback: Add gc collect callback
A background callback must never outlive its related object. By collecting the head of the linked list of background tasks, this will not happen. One hypothetical case where this could happen is if an MP3Decoder is deleted while its callback to fill its buffer is scheduled.
Diffstat (limited to 'supervisor/background_callback.h')
-rw-r--r--supervisor/background_callback.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/supervisor/background_callback.h b/supervisor/background_callback.h
index 82025f6b7..535dd656b 100644
--- a/supervisor/background_callback.h
+++ b/supervisor/background_callback.h
@@ -79,4 +79,9 @@ void background_callback_reset(void);
void background_callback_begin_critical_section(void);
void background_callback_end_critical_section(void);
+/*
+ * Background callbacks may stop objects from being collected
+ */
+void background_callback_gc_collect(void);
+
#endif