public static void InPlaceUpdater(KeyStruct *key, InputStruct *input, ValueStruct *value) { ValueStruct.AcquireWriteLock(value); value->vfield1 += input->ifield1; value->vfield2 += input->ifield2; ValueStruct.ReleaseWriteLock(value); }
public static void ConcurrentWriter(KeyStruct *key, ValueStruct *src, ValueStruct *dst) { ValueStruct.AcquireWriteLock(dst); ValueStruct.Copy(src, dst); ValueStruct.ReleaseWriteLock(dst); }