diff options
-rw-r--r-- | src/pulp.c | 7 | ||||
-rw-r--r-- | src/pulp.h | 1 |
2 files changed, 8 insertions, 0 deletions
@@ -401,6 +401,13 @@ pulp_fiber_t * pulp_fiber_new(pulp_t *pulp, unsigned delay_ms, thunk_t *thunk) } +/* return the current fiber */ +pulp_fiber_t * pulp_self(pulp_t *pulp) +{ + return pulp->current; +} + + /* sleep for the supplied number of microseconds (not public) */ static void pulp_usleep(pulp_t *pulp, unsigned useconds) { @@ -32,5 +32,6 @@ pulp_fiber_t * pulp_fiber_new(pulp_t *pulp, unsigned delay_ms, thunk_t *thunk); void pulp_msleep(pulp_t *pulp, unsigned milliseconds); void pulp_sleep(pulp_t *pulp, unsigned seconds); pulp_usec_t pulp_now(pulp_t *pulp); +pulp_fiber_t * pulp_self(pulp_t *pulp); #endif |