A question about in lock usage in FreeBSD

Conrad Meyer cem at freebsd.org
Wed Jun 14 16:16:17 UTC 2017


On Wed, Jun 14, 2017 at 12:49 AM, Jia-Ju Bai <baijiaju1990 at 163.com> wrote:
> Namely, it is unsafe that the thread calls the function which may sleep when
> the thread holds mutexes, reader/writer locks or read-mostly locks.
> Is it right?

Correct.  sxlocks ("shared-exclusive," although I tend to think of the
"s" as standing for "sleepable") can be held calling functions which
may sleep.

Best,
Conrad


More information about the freebsd-hackers mailing list