int A = 0; int B = 0;
Executed in one thread:
if (A == 1) B = 1;
Executed in another thread:
if (B == 1) A = 1;
Example adjusted from literature, see references.