ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55074] org.apache.tools.ant.property.LocalPropertyStack implementation is not thread-safe
Date Wed, 11 Feb 2015 11:00:50 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55074

Stefan Bodewig <bodewig@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |1.9.5
            Summary|Inefficient                 |org.apache.tools.ant.proper
                   |org.apache.tools.ant.proper |ty.LocalPropertyStack
                   |ty.LocalPropertyStack       |implementation is not
                   |implementation              |thread-safe

--- Comment #3 from Stefan Bodewig <bodewig@apache.org> ---
As additional context: http://marc.info/?t=142130235000003&r=1&w=2

I agree with your analysis.  But it's not only <forget>, the same thing could
happen with other tasks running code that may spawn threads like <java> or
<junit> - it's just less likely they will access the properties.

Wrapping the list in synchronizedList will not be enough since the class uses
the LinkedList API for convenience.  Also addLocal's implementation contains a
race-condition right now.

Too bad there is no Concurrent* implementation of Stack or Deque - we'd need a
ConcurrentLinkedQueue with LIFO semantics.

I'll add a bunch of manual synchronization.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message