Das volatile sorgt nicht für eine globale Sichtbarkeit der Variablen! Du musst sie als globale Variablen (aber weiterhin volatile) anlegen.