The OrderedOutputStream is probably not actually thread-safe
JohnathonNow opened this issue · comments
This kind of locking mechanism does not prevent two threads from accessing the critical section. It should probably just be a synchronized method.
@JohnathonNow Can I also propose that this check is moved to the start of this method?
If the active flag is set to false, you will have a memory leak as you continue to add to the stack despite the run thread no longer consuming things off the stack.
Thanks for the contribution, and I agree with your proposal.