Suppose I have my own non-inline functions LockMutex and UnlockMutex, which are using some proper mutex - such as boost - inside. How will the compiler know not to reorder o
In general, a compiler will not move code around unless it knows with certainty that doing so will not affect run-time behavior.