Specific concurrency-related changes:
- Refactored TaskController to implement the Future interface -- this required changing the types of exceptions thrown by get() and (for consistency) value(). Simplified the requirements for subclassing, lifting the state-change and resource-management logic entirely into the abstract parent class. Updated to fully support concurrent state changes safely. Added some additional methods, including support for listeners.
- Similarly updated IncrementalTaskController. Also changed the interface used to access intermediate results -- they are now added to a single queue, which the client can get and read from.
- Renamed IncrementalTask.isFinished() -> isResolved().
- Defined specific TaskController implementations as public top-level classes rather that private classes nested in ConcurrentUtil. Enhanced these (and the related ConcurrentUtil methods) to support predefined Futures and execution via arbitrary Executors.
- Rewrote SwingWorker to implement IncrementalTaskController (making it more closely match the Java 6 version -- both now implement Future).
- Implemented IncrementalTask execution in a remote process (a long-standing to-do item).
- Eliminated the unnecessary use of threads, where possible. DelayedInterrupter now uses a single thread for the entire class, rather than one per object. Some ConcurrentUtil methods run their tasks with a provided executor rather than threads (keeping the default behavior by defining the simple Executor THREAD_EXECUTOR).
- Added helper methods to ConcurrentUtil to support implementation of timeouts. (This is non-trivial because the semantics of Object.wait() do not distinguish between a timeout and a spurious wake-up.)
- Optimized CompletionMonitor to avoid unnecessary locking; added timeout support to all Monitor classes.
Some other changes:
- Added ListenerSet, a general-purpose facility for providing listener support without the need for custom interface definitions.
- Fixed some concurrency bugs in LazyThunk. Added a similar CachedThunk that supports resetting, and a general ResolvingThunk interface for Thunks that have an "unresolved" and "resolved" state.
- Added SnapshotSynchronizedSet and SnapshotSynchronizedList, enhancements to the Collections.synchronized methods that make copies of their contents for iteration rather than requiring the client to synchronize.
- Added IOUtil.attemptClose, ignoreSystemOut, and ignoreSystemErr.