by vemv · 13y ago · 0 comments
A good example being asynchronous javascript, where you'd do this to prevent issues like the exposed in the article:
var some_mutable_condition = false;
var requested = false;
if (!some_mutable_condition && !requested){
requested = true; // ensure one request is performed at most
$.ajax(/*async code that'll set some_mutable_condition to true*/);
}