parlib: Catch illegal block attempts
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 24 Apr 2017 15:50:29 +0000 (11:50 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 3 May 2017 16:13:02 +0000 (12:13 -0400)
commite6f6b5502d5c43a43ce893d12a1f27a8c852f8bd
treeae0ff508538668a1717663130ace18a3743d7ebd
parentab3632f073394aa88184b902df6edcdef443579b
parlib: Catch illegal block attempts

Without the assert, we can have some code that shouldn't block grab mutexes
and whatnot.  They could have blocked, but they didn't, and then we only
catch the bug in the constested case - rarer and harder to debug.

Now, we'll immediately panic if we try to do something wrong.

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