internal void SetOwnershipRegistration(MetadataReferenceSetOwnershipRegistration registration) { registration.EnsureNotNull(nameof(registration)); // var original = WriteDA(location: ref _ownershipRegistration, value: registration, comparand: null); if (!(original is null || ReferenceEquals(objA: registration, objB: original))) { throw new EonException(); } }
// TODO_HIGH: Удалить. Реализовать автоматическую регистрацию (на основе Linq.Expression(s) и рефлексии). // protected void RegisterReferenceSet(MetadataReferenceSetBase referenceSet, bool useDeserializationContext) { referenceSet.EnsureNotNull(nameof(referenceSet)); // var registration = new MetadataReferenceSetOwnershipRegistration(owner: this, set: referenceSet); ReadDA(location: ref _referenceSetRegistrySpinLock, considerDisposeRequest: true) .Invoke( action: () => { var locRegistry = ReadDA(location: ref _referenceSetRegistry, considerDisposeRequest: true); locRegistry.Add(item: registration); }); registration.SetRegistrationCompleteFlag(); }
protected override void Dispose(bool explicitDispose) { _ownershipRegistration = null; // base.Dispose(explicitDispose); }