1
| <span style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5;">如果两个线程同时执行</span><code style="font-size: 14px; line-height: 1.5;">run()</code><span style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5;">方法,就会出现上图所示的情景。</span><code style="font-size: 14px; line-height: 1.5;">run()</code><span style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5;">方法调用</span><code style="font-size: 14px; line-height: 1.5;">methodOne()</code><span style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5;">方法,</span><code style="font-size: 14px; line-height: 1.5;">methodOne()</code><span style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5;">调用</span><code style="font-size: 14px; line-height: 1.5;">methodTwo()</code><span style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5;">方法。</span>
|