Adding volatile qualifier to shared memory