]> git.proxmox.com Git - mirror_zfs.git/commit
Condition variable reference counts
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 5 Nov 2012 17:04:50 +0000 (09:04 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 6 Nov 2012 22:48:55 +0000 (14:48 -0800)
commitd2733258d09b02fac76af0df9921e369d33e9642
tree13f867e4b937e51448565b0cada51bca3088637b
parent87efc30b270454a372e18f236491b4f0e5bcc30d
Condition variable reference counts

Reference count every entry and exit from the condition variable
functions: cv_wait(), cv_wait_timeout(), cv_signal(), cv_broadcast().

This allows us to safely block in cv_destroy() until all consumers
have been scheduled and are no longer accessing the condition
variable memory.

In addition poison the magic value at the start of cv_destroy() to
ensure there are never any new callers after cv_destroy() is called.
The consumer is responsible for ensuring this never occurs.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/condvar.h
module/spl/spl-condvar.c