@@ -0,0 +1,365 @@
+package com.jfw.thread.safe;%0A%0Apublic class SynCounter implements Runnable %7B%0A%09private int count = 0;%0A%0A%09public void run() %7B%0A%09%09synchronized (this) %7B%0A%09%09%09for (int i = 0; i %3C 1000; i++) %7B%0A%09%09%09%09Math.hypot(Math.pow(92564812, i), Math.cos(i));%0A%09%09%09%7D%0A%09%09%09System.out.println(%22%E7%BA%BF%E7%A8%8B%E5%90%8D%22 + Thread.currentThread());%0A%09%09%09count++;%0A%09%09%7D%0A%09%7D%0A%0A%09public int getCount() %7B%0A%09%09return this.count;%0A%09%7D%0A%7D%0A

Create SynCounter.java