[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: race condition in libports

From: Samuel Thibault
Subject: Re: race condition in libports
Date: Sat, 6 Jan 2018 01:24:19 +0100
User-agent: NeoMutt/20170113 (1.7.2)


Brent W. Baccala, on ven. 05 janv. 2018 17:45:57 -0500, wrote:
> I've "fixed" this by making sure we don't remove the hash table entry unless
> there are exactly two weak references outstanding, but I'm not sure that's the
> best way to handle it.  It doesn't seem like the dropweak routine should have
> to be so careful; it shouldn't get called twice like that.

Well, AIUI from the documentation, dropweak should manage by itself how
many weak references it should drop. I.e. the number of times dropweak
is called doesn't matter, the first call should drop them, and later
calls should be fine that there aren't any to drop any more. So it seems
to me that your proposed fix is correct. I just rewrote it to make sure
to get coherent counts between hard and weak.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]