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

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
rGbd80263606d7: pfsync: Avoid transmitting uninitialized bytes in pfsync_sendout()
Branches
Unknown
Tags
Unknown