Annotation Interface ThreadSafe


@Documented @Retention(CLASS) @Target({TYPE,METHOD}) public @interface ThreadSafe
Indicates that the annotated member may be called on multiple threads at once, or concurrently from the game thread, and therefore the implementation must take care when accessing shared state. For instance methods, this implies that the method is called on the same instance from multiple threads.

When a class is annotated, all methods within that class are considered to be @Concurrent.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the annotated member may also be called from the game thread itself.
  • Element Details

    • withGameThread

      boolean withGameThread
      Whether the annotated member may also be called from the game thread itself.
      Default:
      true