object thisflog = new object()
public void a()
{
for(int i = 0; i< 10 ;i ++)
{
thread th = new thread(new threadstart(b));
th.start(); }
}
public void b()
{
lock(thisflog )
{
c()
} }public void c()
{
lock(this)
{}
}这种情况C中需要加锁嘛 ,或者 会出现死锁嘛
public void a()
{
for(int i = 0; i< 10 ;i ++)
{
thread th = new thread(new threadstart(b));
th.start(); }
}
public void b()
{
lock(thisflog )
{
c()
} }public void c()
{
lock(this)
{}
}这种情况C中需要加锁嘛 ,或者 会出现死锁嘛
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货