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.
Differential D42460
reboot: Avoid unlocking Giant if the scheduler is stopped markj on Nov 3 2023, 8:48 PM. Authored by Tags None Referenced Files
Subscribers
Details When the scheduler is stopped, mtx_unlock() turns into a no-op, so the while (mtx_owned(&Giant)) mtx_unlock(&Giant); runs forever if the calling thread has Giant locked.
Diff Detail
Event TimelineComment Actions Giant is recursive, so it could in principle be held multiple times by the same thread. Comment Actions I thought I'd hit accept yesterday this is fine. Crashes are super weird. I can't think of any other place we do this.. Giant really is special. |