Skip to content
Commit d89249db authored by Andy Ross's avatar Andy Ross Committed by Anas Nashif
Browse files

pthread: Respect cooperative thread schedulign in condition variable



Originally, pthread_cond_signal() was written to yield even in
circumstances where the current thread is at a cooperative priority
and would not expect to be context-switched out until it blocks.  This
makes sense, as in most cases you want the newly signaled thread to
get a chance to run as soon as possible.

On further reflection (and also because it complicates the scheduler),
I think that's wrong.  The point to cooperative scheduling is that it
allows the cooperative code to make synchronization assumptions about
exactly when it might yield to other threads, and having arbitrary
APIs be "preemption points" like this complicates that analysis
significantly.

Use _reschedule() like other code does.

Signed-off-by: default avatarAndy Ross <andrew.j.ross@intel.com>
parent 3f55dafe
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment