HomeFreeBSD

reboot: Avoid unlocking Giant if the scheduler is stopped

Description

reboot: Avoid unlocking Giant if the scheduler is stopped

When the scheduler is stopped, mtx_unlock() turns into a no-op, so the
loop

    while (mtx_owned(&Giant))
	    mtx_unlock(&Giant);

runs forever if the calling thread has Giant locked.

Reviewed by: mhorne
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42460

(cherry picked from commit deacab756026f86515781944a9e0271e8db9f86b)

Details

Provenance
markjAuthored on Nov 4 2023, 2:48 PM
Reviewer
mhorne
Differential Revision
D42460: reboot: Avoid unlocking Giant if the scheduler is stopped
Parents
rG09cca16bfc26: pfsync: Avoid transmitting uninitialized bytes in pfsync_sendout()
Branches
Unknown
Tags
Unknown