Add uthread_paused() API call
authorKevin Klues <klueska@cs.berkeley.edu>
Wed, 11 Nov 2015 02:10:27 +0000 (18:10 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 16 Nov 2015 23:15:03 +0000 (15:15 -0800)
commitadeb4a08c5ebf3bdeb9251aa510ab57e85fa6d09
tree08144b8e731e351c2dc0bced26b45c916fa20c85
parent1da17d2ac5a0212d90583c243bc1ce125aa5af34
Add uthread_paused() API call

This call is much like uthread_has_blocked(), except that it indicates
that some external component has temporarily paused a uthread, rather
than blocked it. That is, the external component calls uthread_yield()
directly, but then wishes to hand control of the uthread back to the 2LS
in the body of theyield callback.

It is the job of the 2LS to implement sched_ops->paused() such that the
thread becomes runnable again. This sched op actually already exists
because things like preemption can trigger it. Now it is triggerable by
any external component that wishes to temporarily pause a uthread with
its own yield call.

This functionality will prove useful when pausing a temporarily pausing
thread to run a signal handler in its place.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/parlib/include/uthread.h
user/parlib/uthread.c