func Atomically(op Operation) interface{} {
	expvars.Add("atomically", 1)
	// run the transaction
	tx := newTx()
retry:
	tx.reset()
	ret, retry := catchRetry(op, tx)
	if retry {
		expvars.Add("retries", 1)
		// wait for one of the variables we read to change before retrying
		tx.wait()
		goto retry
	}
	// verify the read log
	tx.lockAllVars()
	if !tx.verify() {
		tx.unlock()
		expvars.Add("failed commits", 1)
		if profileFailedCommits {
			failedCommitsProfile.Add(new(int), 0)
		}
		goto retry
	}
	// commit the write log and broadcast that variables have changed
	tx.commit()
	tx.unlock()
	expvars.Add("commits", 1)
	tx.recycle()
	return ret
}
// Atomically executes the atomic function fn.
Atomically executes the atomic function fn.
// Atomically executes the atomic function fn .
func Atomically(op Operation) interface{} {
	expvars.Add("atomically", 1)
	tx := newTx()
retry:
	tx.reset()
	ret, retry := catchRetry(op, tx)
	if retry {
		expvars.Add("retries", 1)
		tx.wait()
		goto retry
	}
	tx.lockAllVars()
	if !tx.verify() {
		tx.unlock()
		expvars.Add("failed commits", 1)
		if profileFailedCommits {
			failedCommitsProfile.Add(new(int), 0)
		}
		goto retry
	}
	tx.commit()
	tx.unlock()
	expvars.Add("commits", 1)
	tx.recycle()
	return ret
}
func Atomically ( op Operation ) interface { } { expvars . Add ( " " , 1 ) tx := newTx ( ) retry : tx . reset ( ) ret , retry := catchRetry ( op , tx ) if retry { expvars . Add ( " " , 1 ) tx . wait ( ) goto retry } tx . lockAllVars ( ) if ! tx . verify ( ) { tx . unlock ( ) expvars . Add ( " " , 1 ) if profileFailedCommits { failedCommitsProfile . Add ( new ( int ) , 0 ) } goto retry } tx . commit ( ) tx . unlock ( ) expvars . Add ( " " , 1 ) tx . recycle ( ) return ret }
Atomically executes the atomic function fn.
Atomically executes the atomic function fn .
// run the transaction // wait for one of the variables we read to change before retrying // verify the read log // commit the write log and broadcast that variables have changed