protected void Reduce(RpcResult child_r) {
//The usual transactional bit:
State state = _state;
State old_state;
State new_state;
do {
old_state = state;
new_state = old_state.AddChildResult(child_r);
state = Interlocked.CompareExchange<State>(ref _state, new_state, old_state);
}
while( state != old_state);
//If we need to start a new reduce, it's the latest value:
TryNextReduce(new_state, old_state, child_r, false);
}