Skip to content
Commit e9b288b7 authored by Peter Mitsis's avatar Peter Mitsis Committed by Anas Nashif
Browse files

kernel: mutex: remove unnecessary schedule locking



Removes an unnecessary schedule lock/unlock pair from k_mutex_unlock().

Rationale: Given that only the current thread (which would also be the
mutex owner) will be able to modify the mutex object AND that a
recursive unlock ought never trigger any reschedule (as it does not
touch the pend queue), then performing a schedule lock is not needed
prior to testing for a recursive unlock.

Furthermore, even if it is not a recursive unlock, then a schedule lock
is superfluous as the existing spinlock provides sufficient protection.

Signed-off-by: default avatarPeter Mitsis <peter.mitsis@intel.com>
parent d42b2e6b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment