The keyword synchronize does not appear in the source code of ArrayBlockingQueue. Does that mean I am free to use its intrinsic lock for "my own purposes"? Or could this change in the future?
1 Answer
In general I'd shy away from it, since you could decide to do this, but then someone else on your team or a third party library (perhaps inadvertently) could also rely on having "exclusive" access to the monitor.
It might change in future, and you might not be the only one thinking about this now. If you can achieve what you want to do using private locks and monitors, or via a different system altogether (e.g. executing Futures), then that will be more robust.
(It's an interesting question though, and undoubtedly some people will find my opinion too defensive!)
AbstractBlockingQueuein JDK6. What's its fully qualified name?