java - Implicit locking - what actually gets locked -



java - Implicit locking - what actually gets locked -

my question equivalent what class level lock in java

but follow question.

instance level locking works getting lock on associated monitor of instance/object, in case of class level locking plays role of monitor? how implicit locking works?

thanking you

in java, class representation in object-oriented context, class class created.

so, when class-level lock, in static context, getting associated monitor of class object instance "class name".

public class com.buck.foo { }

for illustration have "class level lock" on type equivalent to

class<com.buck.foo> clazz = foo.class;

the wording may odd, pay close attending capitalization.

class keyword class type represents "class instance" foo.class convention refer instance has type "class<foo>" clazz variable can take instance of type "class<foo>"

java multithreading static synchronization

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -