Skip to content

Commit

Permalink
fix: fixed merge issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
DingpingZhang committed Nov 23, 2021
1 parent 9dd4f4f commit 34ae38f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions HandyIpc/Core/AsyncPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

namespace HandyIpc.Core
{
public sealed class AsyncPool<TValue> : PoolBase<TValue> where TValue : IDisposable
public sealed class AsyncPool<T> : PoolBase<T> where T : IDisposable
{
private readonly Func<Task<T>> _factory;
private readonly Func<T, Task<bool>> _checkValue;

public AsyncPool(Func<Task<TValue>> factory, Func<TValue, Task<bool>> checkValue)
public AsyncPool(Func<Task<T>> factory, Func<T, Task<bool>> checkValue)
{
_factory = factory;
_checkValue = checkValue;
Expand Down
4 changes: 2 additions & 2 deletions HandyIpc/Core/Pool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace HandyIpc.Core
{
public sealed class Pool<TValue> : PoolBase<TValue> where TValue : IDisposable
public sealed class Pool<T> : PoolBase<T> where T : IDisposable
{
private readonly Func<T> _factory;
private readonly Func<T, bool> _checkValue;

public Pool(Func<TValue> factory, Func<TValue, bool> checkValue)
public Pool(Func<T> factory, Func<T, bool> checkValue)
{
_factory = factory;
_checkValue = checkValue;
Expand Down
6 changes: 3 additions & 3 deletions HandyIpc/Core/PoolBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

namespace HandyIpc.Core
{
public abstract class PoolBase<TValue> : IDisposable where TValue : IDisposable
public abstract class PoolBase<T> : IDisposable where T : IDisposable
{
protected readonly ConcurrentBag<TValue> Cache = new();
protected readonly ConcurrentBag<T> Cache = new();

private bool _isDisposed;

Expand All @@ -23,7 +23,7 @@ protected virtual void Dispose(bool disposing)

if (disposing)
{
while (Cache.TryTake(out TValue item))
while (Cache.TryTake(out T item))
{
item.Dispose();
}
Expand Down
8 changes: 4 additions & 4 deletions HandyIpc/Core/RentedValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace HandyIpc.Core
{
public readonly struct RentedValue<TValue> : IDisposable
public readonly struct RentedValue<T> : IDisposable
{
private readonly Action<TValue> _dispose;
private readonly Action<T> _dispose;

public TValue Value { get; }
public T Value { get; }

public RentedValue(TValue value, Action<TValue> dispose)
public RentedValue(T value, Action<T> dispose)
{
_dispose = dispose;
Value = value;
Expand Down

0 comments on commit 34ae38f

Please sign in to comment.