https://issues.apache.org/bugzilla/show_bug.cgi?id=54717
--- Comment #15 from Danny Lade <[email protected]> --- > > Main: create SampleSender, therefore create queue > > Main: start threads > > Thread 1: append map to queue > > The queue entry is set up (i.e. initialised) by a different thread. > > Also Thread 1 adds items to the queue, which are later accessed by a > different thread in testEnded(). This also needs to be done in a way that > ensures safe publication, e.g. by using a thread-safe queue (which seems to > be the case). > I see, yes it is a ConcurrentLinkedQueue. > > So, how to prove? What do you have in mind? > > Code inspection should be used to show that objects shared between threads > are protected by a common lock. As you already found out the lock is only necessary at the beginning (init). Feel free to inspect the ConcurrentLinkedQueue (java.util.concurrent) about it. However, this code works only for a HoldSampleSender, which sends all data at the end at once. I was also thinking about a BatchSampleSender using the same principles in the past. But my project does not needed one, therefore I got no time to implement it. -- You are receiving this mail because: You are the assignee for the bug.
