Allows pthread_yield() before lib_init()
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 14 May 2015 16:29:58 +0000 (12:29 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 15 May 2015 01:35:44 +0000 (21:35 -0400)
commit1c0d4682e2357d9c92f1a2ac11d5b6d1db941089
treeff9a15a2cde0506ad2363db8d72604963abd227c
parenta29fad8a425a48358d5efa5384d3d0e1a82db9f7
Allows pthread_yield() before lib_init()

If we call uthread_yield, we'll eventually pop up in vcore context
expecting to run the 2LS.  We need to initialize pthreads (and uthreads)
before that happens.

One option here was to do a run_once on pthread_lib_init for the yield
entry point, but we don't need to become an MCP just because someone
wanted to briefly yield the processor.  sched_yield() is a better fit.
user/pthread/pthread.c