This project contains utility classes that are used by various products and projects inside Atlassian and may have some utility to the world at large.
Of most general value in production code are:
- LazyReference and ResettableLazyReference a lazily instantiated reference with
- BlockingReference an abstraction that may be used by two threads to exchange a reference or block if no reference is available.
- CopyOnWrite Maps for thread-safe read mostly Maps
- ConcurrentOperationMap for dealing with operations that may interfere if run concurrently, such as inserting an object into a database (deprecated, prefer Guava's ComputingMap)
- ManagedLock for performing operations under lock where the actual lock used may be striped using an arbitrary function
- AsyncCompleter for performing operations in parallel and gathering their results as they arrive.
- BooleanLatch a simple Latch that allows a reader thread to wait for a signal
- PhasedLatch a phased latch that allows threads to wait for specific phases to be complete before continuing
The other classes are mostly useful for test code.
The jar can be downloaded directly from our Maven repository or via the Maven dependency:
<dependency> <groupId>com.atlassian.util.concurrent</groupId> <artifactId>atlassian-util-concurrent</artifactId> <version>2.0.0</version> </dependency>
This code is open source and licensed under Version 2 of the Apache License.