Cleans up preempt_pending helper functions
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 15 Dec 2011 00:41:32 +0000 (16:41 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 15 Dec 2011 22:48:43 +0000 (14:48 -0800)
commita0e75d24f655c797d698169bf1e8a656e33f828a
treed07999c25956ee8e20715913b60b8a4dddc15a24
parent49d4a341a1c398c22ace3840d40df151bd9e1a22
Cleans up preempt_pending helper functions

Don't call __check_preempt_pending() from places that can't handle a
noreturn.  Examples include inside event handlers, while processing an
ev_q (you'll miss messages), while holding locks, etc.  If a preempt is
pending, the vcore will yield and may never come back.  Next time it
runs, it'll be starting fresh from vcore_entry().

If needed, we can make versions of event handlers that can handle
responding to a preempt_pending, but those will need to be careful to
not ignore message queues and stuff like that.  One of the side effects
of not returning is that someone might be expecting you to process all
of your messages, etc.
user/parlib/event.c
user/parlib/include/uthread.h
user/parlib/include/vcore.h
user/parlib/uthread.c
user/pthread/pthread.c