to save the re-entrancy attack, to save the double-spending
none
If you execute the locked function two times, you can’t execute second one.
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_; //execution locked function's codes
unlocked = 1;
}
https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2Pair.sol#L31