Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5234

Unnecessary synchronization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • 1.14.4
    • Yes

       
      I'm from Russia, sorry for the modest knowledge of English
      Maybe I'm wrong, but something tells me that in the class HandlerList(org.bukkit.event) There is excessive synchronization(where it should not be), which can result in poor performance, field handlers (

      private volatile RegisteredListener[] handlers = null;

      ) which is declared as volatile. Such fields can be confusing because access to the array itself follows the rules for volatile fields, but access to the array content does not. the

      private static ArrayList<HandlerList> allLists = new ArrayList<>();

      field is static, why synchronize it?(I could be wrong)

        1. sync1.png
          sync1.png
          9 kB
        2. sync2.png
          sync2.png
          20 kB

            Unassigned Unassigned
            JolyJDIA Sunmisc
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: