MIP.watch('count', function (newVal, oldVal) { fetch('http://www.chazidian.com/kaoshi/ajaxapi/?action=guanzhu&id=126225&type=2') .then(function (res) { var follows2 = MIP.getData('follows') if(follows2==1){ MIP.setData({ follows:2, title:'收藏' }) } if(follows2==2){ console.log(2) MIP.setData({ follows:1, title:'已收藏' }) } }) .catch(function (err) { console.log('数据请求失败!') }) })

根据线程安全的相关知识,分析以下代码,当调用test方法时i>10时是否会引起死锁?并简要说明理由。

publicvoidtest(inti)

{lock(this)

{if(i>10)

{i--;

test(i);

}}}

查看答案
正确答案:

答:不会发生死锁,(但有一点 int 是按值传递的, 所以每次改变的都只是一个副本, 因此不会出现死锁。 但如果把 int 换做一个 object , 那么死锁会发生)

答案解析:

暂无解析

上一题
你可能感兴趣的试题

下列数据类型属于引用类型的是()。

A、bool
B、char
C、string
D、enum

实现一个下拉菜单的HTML代码是_________。

A、
B、
C、
D、

以下Javsscript的运行结果为

varm=false;

if(m==true)

document.write("True");

else

document.write("False");

A、False
B、True
C、None
D、运行时出错

下列语言编写的代码中,在浏览器端执行的是______。

A、Web页面中的c#代码
B、Web页面中的Java代码
C、Web页面中的PHP代码
D、Web页面中的JavaScript代码

在CSS中,设置让超级链接没有下划线的选项是_________。

A、a{decoration:nounderline}
B、a{text-decoration:none}
C、a{underline:none}
D、a{text-decoration:nounderline}
热门试题 更多>
相关题库更多>
公共基础
Python语言程序设计
MS Office高级应用
Web程序设计
MySQL数据库程序设计