summaryrefslogtreecommitdiff
path: root/nuttx/include/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/include/sched.h')
-rw-r--r--nuttx/include/sched.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/nuttx/include/sched.h b/nuttx/include/sched.h
index 0cf8d58d5..12cc29046 100644
--- a/nuttx/include/sched.h
+++ b/nuttx/include/sched.h
@@ -254,6 +254,11 @@ struct _TCB
};
typedef struct _TCB _TCB;
+
+/* This is the callback type used by sched_foreach() */
+
+typedef void (sched_foreach_t)(FAR _TCB *tcb, FAR void *arg);
+
#endif /* __ASSEMBLY__ */
/************************************************************
@@ -341,6 +346,13 @@ EXTERN FAR struct streamlist *sched_getstreams(void);
#endif /* CONFIG_NFILE_STREAMS */
#endif /* CONFIG_NFILE_DESCRIPTORS */
+/* sched_foreach will enumerate over each task and provide the
+ * TCB of each task to a user callback functions. Interrupts
+ * will be disabled throughout this enumeration!
+ */
+
+EXTERN void sched_foreach(sched_foreach_t handler, FAR void *arg);
+
#undef EXTERN
#if defined(__cplusplus)
}