On 15/09/2015 21:18, Felix Schumacher wrote: > > > Am 15. September 2015 21:47:57 MESZ, schrieb Mark Thomas <ma...@apache.org>: >> On 15/09/2015 18:41, Felix Schumacher wrote: >>> Hi Mark, >>> >>> why didn't you remove the synchronization when you converted the code >> to >>> ConcurrentLinkedDeque? >> >> No idea. Focusing on one thing and missing the obvious I suspect. >> >>> The old code had a concurrency problem, since events.size() was >> checked >>> outside of the synchronize block. I think this is not a problem >> anymore, >>> but I don't understand the call to events.clear() afterwards the >>> while-loop in events(). We think we have guarded the queue and >> removed >>> all entries by calling pollFirst repeatedly, so why clear it >> afterwards? >> >> Don't know. I'll take another look and clean it up some more. > > While you are looking at the code. The api docs say that queue.size() is > quite expensive. My guess is, that queue.isEmpty() is quite cheap.
All fixed. (I think.) Thanks for the review. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org