Annotation Interface ThreadBody
@ClassVersion(sourceVersion="$Id: ThreadBody.java 1259 2026-06-05 20:29:42Z tquadrat $")
@API(status=STABLE,
since="0.25.12")
@Documented
@Retention(SOURCE)
@Target(METHOD)
public @interface ThreadBody
The marker annotation for methods that will be executed inside
a dedicated thread, either as explicit implementations of
Runnable
or inside a
Runnable.run()
method.
This can look like this
public final class MyClass
{
@ThreadBody
private static final void worker() {…}
public static final void main( final String... args )
{
new Thread( MyClass::worker ).start();
} // main()
}
// class MyClass
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: ThreadBody.java 1259 2026-06-05 20:29:42Z tquadrat $
- Since:
- 0.25.12
