[BUG] Variable stopmachine_state should be volatile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>


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


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux