aboutsummaryrefslogtreecommitdiff
path: root/src/or/scheduler.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-10-03 13:58:22 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-10-03 14:43:09 -0400
commit2e8de0de3b5ae10277cd0fd72e782d2f6aa30c81 (patch)
tree5ab18dc9862b42c48d7c6dce0dedb5a9590cccba /src/or/scheduler.h
parent1e7e36da4b6741235e77d97fff8446a6b7ba1300 (diff)
downloadtor-2e8de0de3b5ae10277cd0fd72e782d2f6aa30c81.tar.gz
tor-2e8de0de3b5ae10277cd0fd72e782d2f6aa30c81.zip
sched: Implement SCHED_BUG()
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/scheduler.h')
-rw-r--r--src/or/scheduler.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/scheduler.h b/src/or/scheduler.h
index 0ec24db931..47c98f096a 100644
--- a/src/or/scheduler.h
+++ b/src/or/scheduler.h
@@ -143,6 +143,14 @@ MOCK_DECL(void, scheduler_channel_has_waiting_cells, (channel_t *chan));
/*********************************
* Defined in scheduler.c
*********************************/
+
+/* Triggers a BUG() and extra information with chan if available. */
+#define SCHED_BUG(cond, chan) \
+ (PREDICT_UNLIKELY(cond) ? \
+ ((BUG(cond)) ? (scheduler_bug_occurred(chan), 1) : 0) : 0)
+
+void scheduler_bug_occurred(const channel_t *chan);
+
smartlist_t *get_channels_pending(void);
MOCK_DECL(int, scheduler_compare_channels,
(const void *c1_v, const void *c2_v));