Date: Wed, 4 Feb 2015 14:03:22 +0000 From: "julian (JulianElischer)" <phabric-noreply@FreeBSD.org> To: freebsd-net@freebsd.org Subject: [Differential] [Commented On] D1711: Changes to the callout code to restore active semantics and also add a test-framework and test to validate thecallout code (and potentially for use by other tests). Message-ID: <57443999a8bd0b310f9bea2e2412360d@localhost.localdomain> In-Reply-To: <differential-rev-PHID-DREV-vhk6ww63dvpj6egspuyt-req@FreeBSD.org> References: <differential-rev-PHID-DREV-vhk6ww63dvpj6egspuyt-req@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
julian added a comment. let me see if this is correct.. I'm assuming that the reference count can not change if you hold the lock? if so then before releasing the lock, we can check if the count is 1.. if it is then we are the only person who even knows where this thing is so there can't be any new references added.. having stopped the callout action from happening we inherit it's reference. If it IS 1 then we can drop the lock because no one else can get it, and we can then drop the reference safely. the question is what to do if it is NOT 1? can that happen? who else might hold a reference..? we drop the lock, and wait a moment, and then retake the lock and retry? if it can not be > 1 then maybe an assert to that affect may be a safe thing to add. REVISION DETAIL https://reviews.freebsd.org/D1711 To: rrs, gnn, rwatson, lstewart, jhb, kostikbel, hselasky, adrian, imp, sbruno Cc: julian, hiren, jhb, kostikbel, emaste, delphij, neel, erj, freebsd-net
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?57443999a8bd0b310f9bea2e2412360d>