parlib: Add uthread_sched_yield()
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 12 Apr 2017 17:29:00 +0000 (13:29 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 3 May 2017 16:13:02 +0000 (12:13 -0400)
commitc2fd728fc625514e979079357fca20df45279c6f
tree19d467f1f866be712a7b810de8db6ee45662e201
parentfc62f17d36cfddf643bdb155a6e0045874ef11cc
parlib: Add uthread_sched_yield()

Like pthread_yield(), but it works for all 2LSs.  It can also handle if you
are a single-threaded process (no 2LS and also an SCP).  When you have
multiple threads, you yield in favor of those other threads.  Otherwise,
you yield in favor of other processes.

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