Skip to content

InitExecutor may repeat "doInit" #3

Closed

Description

@xuyue531

InitExecutor#doInit() may be executed repeatedly.

we can do this to avoid repeat doInit.

private static AtomicBoolean initialized = new AtomicBoolean(false);
...
public static void doInit() {
  if (!initialized.compareAndSet(false, true)) {
       return;
  }
  ...
}

Activity

  1. sczyh30 commented on Jul 24, 2018

    @sczyh30
    Member

    Thanks for reporting!

  2. CodeIngL commented on Jul 30, 2018

    @CodeIngL

    it only happen in staic { }. is it a NotThreadSafe ? It is ThreadSafe

  3. added a commit that references this issue on Mar 5, 2020
  4. added a commit that references this issue on Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions