From a58020451649cb5efc6052a50c0a9a9d810d3802 Mon Sep 17 00:00:00 2001 From: keramida Date: Wed, 5 Jan 2005 22:04:12 +0000 Subject: Make an attempt at explaining why sx(9) locks cannot be safely obtained after acquiring a mutex(9). PR: docs/75571 Submitted by: darrenr Explanation by: jhb --- share/man/man9/sx.9 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/man/man9/sx.9 b/share/man/man9/sx.9 index 17ab206..9e5f0eb 100644 --- a/share/man/man9/sx.9 +++ b/share/man/man9/sx.9 @@ -196,6 +196,15 @@ attempting to do so will result in deadlock. A thread may hold a shared or exclusive lock on an .Nm lock while sleeping. +As a result, an +.Nm +lock may not be acquired while holding a mutex. +Otherwise, if one thread slept while holding an +.Nm +lock while another thread blocked on the same +.Nm +lock after acquiring a mutex, then the second thread would effectively +end up sleeping while holding a mutex, which is not allowed. .Sh SEE ALSO .Xr condvar 9 , .Xr mtx_pool 9 , -- cgit v1.1