[concurrency-interest] Better support for custom locks

Doug Lea dl@cs.oswego.edu
Sat, 27 Dec 2003 15:04:57 -0500

While improving implementations of locks and related classes we came
upon a nicer factoring that allows simpler user (that's you :-)
construction of other lock and synchronization classes, without
sacrificing the need to keep internals of our main exported classes
non-public (thus allowing replacement someday if necessary). The class
AbstractQueuedSynchronizer replaces the previous
AbstractReentrantLock, keeping the same functionality, but repackaging
it to be extensible outside of the locks subpackage.  Class
AbstractQueuedSynchronizer is not exactly trivial to extend and use
for custom synchronizers, but, we hope, much easier/better than
alternatives.  I think those of you who have complained about needing
to copy/paste/hack when making new sync classes can stop doing that
now. If you'd like to give a shot at using it and report back
experiences, we'd be grateful.

Doug Lea, Computer Science Department, SUNY Oswego, Oswego, NY 13126 USA
dl@cs.oswego.edu 315-312-2688 FAX:315-312-5424 http://gee.cs.oswego.edu/