我有两个班级
set
据我所知,方法SELECT t1.*
,(SELECT COUNT(*) FROM TABLE2 t2 WHERE t1.id = t2.id) AS Counter
FROM TABLE1 t1
WHERE t1.status = 'A';
在类public class A {
private byte[] buf;
public synchronized void foo() {
// does something with buf
}
public class B {
public synchronized void bar() {
// also does something with buf
}
}
}
的实例上同步。如何在课程bar()
的对象上同步它以保护B
?