Additional example of using volatile variables.

Preventing compiler optimization that could break desirable program flow.