kernel: futex: Allow for fast return on k_futex_wake()
Updates k_futex_wake() to allow for a fast return path when no threads were waiting. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
parent
f5c343fc93
commit
c6ed03f66a
1 changed files with 5 additions and 1 deletions
|
@ -47,7 +47,11 @@ int z_impl_k_futex_wake(struct k_futex *futex, bool wake_all)
|
|||
}
|
||||
} while (thread && wake_all);
|
||||
|
||||
z_reschedule(&futex_data->lock, key);
|
||||
if (woken == 0) {
|
||||
k_spin_unlock(&futex_data->lock, key);
|
||||
} else {
|
||||
z_reschedule(&futex_data->lock, key);
|
||||
}
|
||||
|
||||
return woken;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue