[BUG] Variable stopmachine_state should be volatile

From: Zhang, Yanmin
Date: Tue Nov 29 2005 - 21:04:16 EST


The model to access variable stopmachine_state is that a main thread
writes it and other threads read it. Its declaration has no sign
volatile. In the while loop in function stopmachine, this variable is
read, and compiler might optimize it by reading it once before the loop
and not reading it again in the loop, so the thread might enter dead
loop.

Here is the patch to fix it.

Signed-off-by: Zhang Yanmin <yanmin.zhang@xxxxxxxxx>


Attachment: stopmachine_state_volatile_2.6.15_rc3.patch
Description: stopmachine_state_volatile_2.6.15_rc3.patch