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 --- testcases/kernel/mem/mtest05/mmstress.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)