允许:
static a;
for (static int i=0; i<10; i++)
{
a++;
///// point A
}
......
i m not sure about something.... what will happen in case thread1 gets into POINT A , stay there, while THREAD2 gets into the loop 10 times, but after the 10 th loop after incrementing i s value to 10, before checking i s value if it s less then 10, Thread1 is getting out of the loop and suppose to increment i and get into the loop again. what s the value that Thread1 will increment (which i will he see) ? will it be 10 or 0 ?
Thread1的种植面积将增至1,而后2的种植面积将再增加9倍(可能为8,7,等等)。
感谢