[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).

julian (JulianElischer) phabric-noreply at FreeBSD.org
Wed Feb 4 14:03:23 UTC 2015


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


More information about the freebsd-net mailing list