Jean-Jacques Clar wrote:
To remove the 2 noted possible race situations, in addition to another possible
one in store_body(),
ooops! I missed that one
we could add the following 2 recursive functions, that have to be called under the protection of the lock (it is now for all 3 cases of atomic_set32()):
That would work I think. But I prefer the idea of using an extra increment to the refcount to represent the reference from the hash table rather than having a separate cleanup bit. Then all the former cleanup bit manipulations become apr_atomic_inc() or _dec() and the code is simpler.
I'm going to see if I can make 2.0.51 blow up, then try Bill's patch with 2 small tweaks - one to eliminate an "if" statement, the other to restore the code in decrement_refcount() that removes an incomplete object from the cache (reworked of course).
Greg