monitorenter


Description: lock object for synchronized execution

Stack

Before After
object to be locked       

Example

Jasm-------------------

aload_1      ; push object in local var 1
monitorenter      ; acquire lock on object
( do stuff to object )      ;
monitorexit      ; release lock
     ;

Exceptions

NullPointerException if object is null

Back to
Opcodes indexed by function.
Opcodes indexed by number.


back to opcode reference.