mirror of
https://github.com/opnsense/src.git
synced 2026-06-07 07:42:26 -04:00
Microoptimize rangelock_unlock_int()
Only broadcast if there are sleepers. Suggested by: markj Reviewed by: markj, Olivier Certner <olce.freebsd@certner.fr> Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D41787
This commit is contained in:
parent
5badbeeaf0
commit
c31580080e
1 changed files with 5 additions and 1 deletions
|
|
@ -160,13 +160,17 @@ rl_e_is_rlock(const struct rl_q_entry *e)
|
|||
static void
|
||||
rangelock_unlock_int(struct rangelock *lock, struct rl_q_entry *e)
|
||||
{
|
||||
bool sleepers;
|
||||
|
||||
MPASS(lock != NULL && e != NULL);
|
||||
MPASS(!rl_e_is_marked(rl_q_load(&e->rl_q_next)));
|
||||
MPASS(e->rl_q_owner == curthread);
|
||||
|
||||
rl_e_mark(e);
|
||||
sleepers = lock->sleepers;
|
||||
lock->sleepers = false;
|
||||
sleepq_broadcast(&lock->sleepers, SLEEPQ_SLEEP, 0, 0);
|
||||
if (sleepers)
|
||||
sleepq_broadcast(&lock->sleepers, SLEEPQ_SLEEP, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in a new issue