diff options
Diffstat (limited to 'src/pulp.c')
-rw-r--r-- | src/pulp.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |