mmstress: make shared global variables volatile

Synchronization of threads depends on shared global variable.
With gcc version 4.6.2 this test spins forever on:
     while (wait_thread)
         sched_yield();

Make global shared variables volatile, so each thread
sees current value.

See also:
Bug 36081 - gcc optimizations and threads (pthread)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36081

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
1 file changed