Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

NestedSynchronized.java 282B

123456789101112131415161718
  1. public class NestedSynchronized {
  2. static Object lockA = new Object();
  3. static Object lockB = new Object();
  4. static int bug() {
  5. synchronized (lockA) {
  6. synchronized (lockB) {
  7. return 0;
  8. }
  9. }
  10. }
  11. public static void main(String[] args) {
  12. bug();
  13. }
  14. }