请问各位下头这短代码运行时候会锁死吗?为什么我这运行锁不死???????
class TestSyncDeath
{
public static void main(String[] args)
{
Tsync ts = new Tsync();
new Thread(ts).start();
ts.b = false;
new Thread(ts).start();

}
}class Tsync implements Runnable
{
boolean b = true;
String str = new String("");
public void run()
{
if(true)
{
while(true)
{
synchronized(str)
{
System.out.println(Thread.currentThread().getName() + "run");
try{Thread.sleep(10);}catch(Exception e){}
synchronized(this){} }
}
}else
{
while(true)
{
tSy();
}
}
}

public synchronized void tSy()
{
System.out.println(Thread.currentThread().getName() + "run");
synchronized(str){}
}
}