diff --git a/javaturorial.iml b/javaturorial.iml deleted file mode 100644 index 4e3316b..0000000 --- a/javaturorial.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/cn/byhieg/threadtutorial/char02/ExceptionService.java b/src/main/java/cn/byhieg/threadtutorial/char02/ExceptionService.java index 4601da7..7fddd82 100644 --- a/src/main/java/cn/byhieg/threadtutorial/char02/ExceptionService.java +++ b/src/main/java/cn/byhieg/threadtutorial/char02/ExceptionService.java @@ -18,6 +18,7 @@ synchronized public void getFile(){ System.out.println("end" + System.currentTimeMillis() + " " + Thread.currentThread().getName()); } catch (FileNotFoundException | InterruptedException e) { + //同步方法出现exception,则会释放锁 try { Thread.sleep(1000); } catch (InterruptedException e1) {