aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/mutex.h')
-rw-r--r--sys/sys/mutex.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h
index 1e88e106d8bf..d39df0f78b3e 100644
--- a/sys/sys/mutex.h
+++ b/sys/sys/mutex.h
@@ -370,7 +370,8 @@ do { \
\
if (mtx_owned(&Giant)) { \
WITNESS_SAVE(&Giant.lock_object, Giant); \
- for (_giantcnt = 0; mtx_owned(&Giant); _giantcnt++) \
+ for (_giantcnt = 0; mtx_owned(&Giant) && \
+ !SCHEDULER_STOPPED(); _giantcnt++) \
mtx_unlock(&Giant); \
}