summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2007-07-03 17:42:37 +0000
committerkib <kib@FreeBSD.org>2007-07-03 17:42:37 +0000
commit0ae42a409556e8dd0fe24abe1db9159f80d1d3a0 (patch)
treecb3718e3a301e214d2cb4e0f64469a55da81c6f6 /lib/libc
parente711aeee1e917cbb6158fb8c6acd203b13f521df (diff)
downloadFreeBSD-src-0ae42a409556e8dd0fe24abe1db9159f80d1d3a0.zip
FreeBSD-src-0ae42a409556e8dd0fe24abe1db9159f80d1d3a0.tar.gz
Since rev. 1.199 of sys/kern/kern_conf.c, the thread that calls
destroy_dev() from d_close() cdev method would self-deadlock. devfs_close() bump device thread reference counter, and destroy_dev() sleeps, waiting for si_threadcount to reach zero for cdev without d_purge method. destroy_dev_sched() could be used instead from d_close(), to schedule execution of destroy_dev() in another context. The destroy_dev_sched_drain() function can be used to drain the scheduled calls to destroy_dev_sched(). Similarly, drain_dev_clone_events() drains the events clone to make sure no lingering devices are left after dev_clone event handler deregistered. make_dev_credf(MAKEDEV_REF) function should be used from dev_clone event handlers instead of make_dev()/make_dev_cred() to ensure that created device has reference counter bumped before cdev mutex is dropped inside make_dev(). Reviewed by: tegge (early versions), njl (programming interface) Debugging help and testing by: Peter Holm Approved by: re (kensmith)
Diffstat (limited to 'lib/libc')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud