Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-578

add double null check to asm stub builders

XMLWordPrintable

    • Icon: Patch Patch
    • Resolution: Done
    • Icon: Major Major
    • 6.2.0.Beta2
    • 6.1.0.Beta1, 6.1.0.Beta2, 6.1.0.Beta3, 6.1.0.Beta4, 6.1.0.CR1, 6.1.0.CR2, 6.1.0.Final
    • None
    • None

      currently the code generated does a null check within the synchronized code. this forces all threads to block while the check is made even after the check returns false. by adding a double null check, the synchronized code is bypassed once the check is satisfied.

      public void evaluate(KnowledgeHelper paramKnowledgeHelper, WorkingMemory paramWorkingMemory)
      throws Exception
      {
      if (this.consequence == null) {
      synchronized (this) {
      if (this.consequence == null)

      { ConsequenceGenerator.generate(this, paramKnowledgeHelper, paramWorkingMemory); }

      }
      }
      this.consequence.evaluate(paramKnowledgeHelper, paramWorkingMemory);
      }

              mfusco@redhat.com Mario Fusco
              david30856 david hendi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: