@Retention(value=RUNTIME) @Target(value=TYPE) public @interface SingleThreaded
@SingleThreaded documents that a class is not thread-safe and should
be used by one thread only. Library maintainers can employ it to flag
non-concurrent designs.
Retention and effect: Retained at runtime but imposes no automatic restrictions unless Chronicle tooling validates it.
@SingleThreaded
final class IdGenerator { }
Chronicle runtime checks this contract unless
AbstractCloseable.singleThreadedCheckDisabled()
is enabled. Call singleThreadedCheckReset() before handing the
instance to another thread. Violations may lead to subtle data races.
Copyright © 2026 Chronicle Software Ltd. All rights reserved.