|
@@ -270,7 +270,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
private readonly IScheduler _scheduler;
|
|
private readonly IScheduler _scheduler;
|
|
|
private readonly object _gate = new object();
|
|
private readonly object _gate = new object();
|
|
|
private readonly Queue<List<TSource>> _q = new Queue<List<TSource>>();
|
|
private readonly Queue<List<TSource>> _q = new Queue<List<TSource>>();
|
|
|
- private IDisposable? _timerSerial;
|
|
|
|
|
|
|
+ private SerialDisposableValue _timerSerial;
|
|
|
|
|
|
|
|
public _(TimeSliding parent, IObserver<IList<TSource>> observer)
|
|
public _(TimeSliding parent, IObserver<IList<TSource>> observer)
|
|
|
: base(observer)
|
|
: base(observer)
|
|
@@ -299,7 +299,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
{
|
|
{
|
|
|
if (disposing)
|
|
if (disposing)
|
|
|
{
|
|
{
|
|
|
- Disposable.Dispose(ref _timerSerial);
|
|
|
|
|
|
|
+ _timerSerial.Dispose();
|
|
|
}
|
|
}
|
|
|
base.Dispose(disposing);
|
|
base.Dispose(disposing);
|
|
|
}
|
|
}
|
|
@@ -314,7 +314,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
{
|
|
{
|
|
|
var m = new SingleAssignmentDisposable();
|
|
var m = new SingleAssignmentDisposable();
|
|
|
|
|
|
|
|
- Disposable.TrySetSerial(ref _timerSerial, m);
|
|
|
|
|
|
|
+ _timerSerial.Disposable = m;
|
|
|
|
|
|
|
|
var isSpan = false;
|
|
var isSpan = false;
|
|
|
var isShift = false;
|
|
var isShift = false;
|
|
@@ -443,11 +443,11 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
{
|
|
{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private IDisposable? _periodicDisposable;
|
|
|
|
|
|
|
+ private SingleAssignmentDisposableValue _periodicDisposable;
|
|
|
|
|
|
|
|
public void Run(TimeHopping parent)
|
|
public void Run(TimeHopping parent)
|
|
|
{
|
|
{
|
|
|
- Disposable.SetSingle(ref _periodicDisposable, parent._scheduler.SchedulePeriodic(this, parent._timeSpan, static @this => @this.Tick()));
|
|
|
|
|
|
|
+ _periodicDisposable.Disposable = parent._scheduler.SchedulePeriodic(this, parent._timeSpan, static @this => @this.Tick());
|
|
|
Run(parent._source);
|
|
Run(parent._source);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -455,7 +455,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
{
|
|
{
|
|
|
if (disposing)
|
|
if (disposing)
|
|
|
{
|
|
{
|
|
|
- Disposable.Dispose(ref _periodicDisposable);
|
|
|
|
|
|
|
+ _periodicDisposable.Dispose();
|
|
|
}
|
|
}
|
|
|
base.Dispose(disposing);
|
|
base.Dispose(disposing);
|
|
|
}
|
|
}
|
|
@@ -529,7 +529,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
_parent = parent;
|
|
_parent = parent;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private IDisposable? _timerSerial;
|
|
|
|
|
|
|
+ private SerialDisposableValue _timerSerial;
|
|
|
private int _n;
|
|
private int _n;
|
|
|
private int _windowId;
|
|
private int _windowId;
|
|
|
|
|
|
|
@@ -547,7 +547,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
{
|
|
{
|
|
|
if (disposing)
|
|
if (disposing)
|
|
|
{
|
|
{
|
|
|
- Disposable.Dispose(ref _timerSerial);
|
|
|
|
|
|
|
+ _timerSerial.Dispose();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
base.Dispose(disposing);
|
|
base.Dispose(disposing);
|
|
@@ -556,7 +556,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
private void CreateTimer(int id)
|
|
private void CreateTimer(int id)
|
|
|
{
|
|
{
|
|
|
var m = new SingleAssignmentDisposable();
|
|
var m = new SingleAssignmentDisposable();
|
|
|
- Disposable.TrySetSerial(ref _timerSerial, m);
|
|
|
|
|
|
|
+ _timerSerial.Disposable = m;
|
|
|
|
|
|
|
|
m.Disposable = _parent._scheduler.ScheduleAction((@this: this, id), _parent._timeSpan, static tuple => [email protected](tuple.id));
|
|
m.Disposable = _parent._scheduler.ScheduleAction((@this: this, id), _parent._timeSpan, static tuple => [email protected](tuple.id));
|
|
|
}
|
|
}
|
|
@@ -654,7 +654,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
private readonly Func<IObservable<TBufferClosing>> _bufferClosingSelector;
|
|
private readonly Func<IObservable<TBufferClosing>> _bufferClosingSelector;
|
|
|
|
|
|
|
|
private List<TSource> _buffer = new List<TSource>();
|
|
private List<TSource> _buffer = new List<TSource>();
|
|
|
- private IDisposable? _bufferClosingSerialDisposable;
|
|
|
|
|
|
|
+ private SerialDisposableValue _bufferClosingSerialDisposable;
|
|
|
|
|
|
|
|
public _(Selector parent, IObserver<IList<TSource>> observer)
|
|
public _(Selector parent, IObserver<IList<TSource>> observer)
|
|
|
: base(observer)
|
|
: base(observer)
|
|
@@ -673,7 +673,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
{
|
|
{
|
|
|
if (disposing)
|
|
if (disposing)
|
|
|
{
|
|
{
|
|
|
- Disposable.Dispose(ref _bufferClosingSerialDisposable);
|
|
|
|
|
|
|
+ _bufferClosingSerialDisposable.Dispose();
|
|
|
}
|
|
}
|
|
|
base.Dispose(disposing);
|
|
base.Dispose(disposing);
|
|
|
}
|
|
}
|
|
@@ -695,7 +695,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var closingObserver = new BufferClosingObserver(this);
|
|
var closingObserver = new BufferClosingObserver(this);
|
|
|
- Disposable.TrySetSerial(ref _bufferClosingSerialDisposable, closingObserver);
|
|
|
|
|
|
|
+ _bufferClosingSerialDisposable.Disposable = closingObserver;
|
|
|
closingObserver.SetResource(bufferClose.SubscribeSafe(closingObserver));
|
|
closingObserver.SetResource(bufferClose.SubscribeSafe(closingObserver));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -786,7 +786,7 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
private readonly object _gate = new object();
|
|
private readonly object _gate = new object();
|
|
|
|
|
|
|
|
private List<TSource> _buffer = new List<TSource>();
|
|
private List<TSource> _buffer = new List<TSource>();
|
|
|
- private IDisposable? _boundariesDisposable;
|
|
|
|
|
|
|
+ private SingleAssignmentDisposableValue _boundariesDisposable;
|
|
|
|
|
|
|
|
public _(IObserver<IList<TSource>> observer)
|
|
public _(IObserver<IList<TSource>> observer)
|
|
|
: base(observer)
|
|
: base(observer)
|
|
@@ -796,14 +796,14 @@ namespace System.Reactive.Linq.ObservableImpl
|
|
|
public void Run(Boundaries parent)
|
|
public void Run(Boundaries parent)
|
|
|
{
|
|
{
|
|
|
Run(parent._source);
|
|
Run(parent._source);
|
|
|
- Disposable.SetSingle(ref _boundariesDisposable, parent._bufferBoundaries.SubscribeSafe(new BufferClosingObserver(this)));
|
|
|
|
|
|
|
+ _boundariesDisposable.Disposable = parent._bufferBoundaries.SubscribeSafe(new BufferClosingObserver(this));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
protected override void Dispose(bool disposing)
|
|
protected override void Dispose(bool disposing)
|
|
|
{
|
|
{
|
|
|
if (disposing)
|
|
if (disposing)
|
|
|
{
|
|
{
|
|
|
- Disposable.Dispose(ref _boundariesDisposable);
|
|
|
|
|
|
|
+ _boundariesDisposable.Dispose();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
base.Dispose(disposing);
|
|
base.Dispose(disposing);
|