Race condition
Race conditions arise in software when an application depends on the sequence or timing of processes or threads for it to operate properly. As with electronics, there are critical race conditions that result in invalid execution and bugs. Critical race conditions often happen when the processes or threads depend on some shared state. Operations upon shared states are critical sections that must be mutually exclusive. Failure to obey this rule opens up the possibility of corrupting the shared state.
Reentrancy (computing)
In the above, depends on a non-constant global variable ; thus, if two threads execute it and access concurrently, a race condition results. The value of and, therefore, the return value of , cannot be predicted with confidence: they will vary depending on the timing of the execution. Hence, is not reentrant. Neither is , because it calls , which is not reentrant.