// add the previous version to the reversion list
addToReversionList(key, prev);
// get the value to return before clearing the result
SharedData out = null;
if (prev != null) {
out = prev.peek();
// clear the previous value, so anyone waiting on it will get
// this replacement