Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nrf fromtree] kernel/workq: Cleanup bespoke reschedule point
The work queue has a semi/non-standard reschedule point implemented using k_yield(), with a check to see if the current thread is preemptible. Just call z_reschedule_unlocked(), it has this check internally and is the intended API for this. Really, this is only a half fix. Ideally the schedule point and the lock release should be atomic[1] via the more idiomatic z_reschedule(). But that would take some surgery, so let's go with the simpler cleanup first. This also avoids having to duplicate logic that gets added to reschedule points by an upcoming patch. [1] So that they represent a condition variable and don't race at the end. In this case the race is present but benign, since the only thing we really want to know is that the queue thread gets a chance to run. The only cost is an occasional duplicated/needless context switch if two threads are racing on a submit. Signed-off-by: Andy Ross <andrew.j.ross@intel.com> Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no> (cherry picked from commit b676d48)
- Loading branch information