I don't really see the difference of execution between
public void foo_fct( Table Tbl, Account act)
{
synchronized(Tbl) {
...
}
}
and this :
public void foo_fct( Table Tbl, Account act)
{
synchronized(act) {
...
}
}
I mean, under the hood, the JVM must use lock() and unlock() I guess? So whatever it happens (act or Tbl) I will be locking in the same way no ?
update Ok, I understand now with your help and Java doc :
"...Every object has an intrinsic lock associated with it..."
and "synchronized statements..."
synchronizeddoes?