1

Does java monitor include instance variables.

view story
linux-howto

http://forums.fedoraforum.org – Is it that monitor in java does not restrict access to instance variables and only to the methods which are declared synchronized or code in synchronized statements? I have created two threads, thread y invokes sync method , which is declared synchronized while thread r invokes unsync method which is not declared synchronized. Both invoke methods on shared object s(stuff). Thread r is able to modify the instance variable of object s while the monitor or lock of that object is still hold by the thread y. Is it that monitor in java does not restrict access to instance variables and on (HowTos)