在一个线程类中有下面两种同步方法  第一种写法
  
    public void run() {
        while (true)
        {
             synchronized (this) {
                 ........
               }
         }
     }
    第二种写法
 
  
    private Object indexLock = new Object();    public void run() {
        while (true)
        {
             synchronized (indexLock) {
                 ........
               }
         }
     }
  
 请问这两种同步方法有什么不同???