110,567
社区成员
发帖
与我相关
我的任务
分享
class My
{
public static string 可重入(int i)
{
// 函数是static,但是可以重入。
return "双倍=" + (i+i);
}
public static string 不可重入(int i)
{
si = i;
// 如果这时其他线程条调用该函数,si就会被覆盖,结果就是错误的。
return "双倍=" + (si + i);
}
static int si;
}