Skip to content

Error on synchronization on objects in Java #153

Description

@mgudemann

This example fails with unexpected statement: monitorenter

public class monitorenter1
{
  public boolean doIt(boolean b)
  {
    boolean a;
    synchronized(this) {
      a = !b;
    }
    return a;
  }
  public void test()
  {
    assert(doIt(false));
  }
}

the critical section is enclosed between monitorenter and monitorexit in the bytecode.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions