[RFC][netx]: unsafe write to HashMap
Andrew Haley
aph at redhat.com
Tue Apr 5 09:18:54 PDT 2011
On 04/05/2011 05:13 PM, Denis Lila wrote:
> I think I found a concurrency problem in
> ResourceTracker.addResource. This method is not static.
> It is called from different threads, and it writes to
> downloadOptions which is a static HashMap. This is not
> safe. The patch uses a ConcurrentHashMap. That should
> be enough to fix it.
If you need the Map to be safe for concurrent access, then you should
say so in its type, no?
Andrew.
More information about the distro-pkg-dev
mailing list