summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pulp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pulp.c b/src/pulp.c
index e472fb9..f57f077 100644
--- a/src/pulp.c
+++ b/src/pulp.c
@@ -410,7 +410,7 @@ static void pulp_schedule(pulp_t *pulp)
/* Tick a pulp scheduler - runs fibers until all are idle/sleeping.
*
* An estimate of how much time may pass before the next tick should occur is
- * stored in next_tick_delay_us.
+ * stored in next_tick_delay_us (if non-NULL).
*
* If pulp_exit() is called by a fiber, or no more fibers exist, the return
* value is -1, and next_tick_delay_us is ignored.
@@ -442,7 +442,8 @@ int pulp_tick(pulp_t *pulp, unsigned *next_tick_delay_us)
if (!list_empty(&pulp->fibers.sleep)) {
/* TODO: get delay from the sleep queue when it's a priority queue */
- *next_tick_delay_us = 333;
+ if (next_tick_delay_us)
+ *next_tick_delay_us = 333;
return 1;
}
© All Rights Reserved