Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Commit

Permalink
updates, removing dep on thrower
Browse files Browse the repository at this point in the history
  • Loading branch information
pomma89 committed Jun 20, 2017
1 parent 2e97ddc commit 327c7b3
Show file tree
Hide file tree
Showing 8 changed files with 2,367 additions and 25 deletions.
2,353 changes: 2,353 additions & 0 deletions src/CodeProject.ObjectPool/App_Packages/LibLog.4.2/LibLog.cs

Large diffs are not rendered by default.

12 changes: 1 addition & 11 deletions src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<AssemblyName>CodeProject.ObjectPool</AssemblyName>
<AssemblyTitle>Generic and concurrent Object Pool</AssemblyTitle>
<VersionPrefix>3.0.3</VersionPrefix>
<TargetFrameworks>netstandard1.0;netstandard1.1;netstandard1.2;netstandard1.3;net35;net40;net45</TargetFrameworks>
<TargetFrameworks>netstandard1.0;netstandard1.3;net35;net40;net45</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyOriginatorKeyFile>../../pomma89.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand Down Expand Up @@ -42,16 +42,6 @@
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
<DefineConstants>$(DefineConstants);NETSTD11;LIBLOG_PORTABLE</DefineConstants>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.2' ">
<DefineConstants>$(DefineConstants);NETSTD12;LIBLOG_PORTABLE</DefineConstants>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>$(DefineConstants);NETSTD13;LIBLOG_PORTABLE</DefineConstants>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
Expand Down
5 changes: 2 additions & 3 deletions src/CodeProject.ObjectPool/ObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/

using CodeProject.ObjectPool.Core;
using PommaLabs.Thrower;
using System;
using System.Linq;
using System.Threading;
Expand Down Expand Up @@ -79,7 +78,7 @@ public ObjectPool(Func<T> factoryMethod)
public ObjectPool(int maximumPoolSize, Func<T> factoryMethod)
{
// Preconditions
Raise.ArgumentOutOfRangeException.IfIsLessOrEqual(maximumPoolSize, 0, nameof(maximumPoolSize), ErrorMessages.NegativeOrZeroMaximumPoolSize);
if (maximumPoolSize <= 0) throw new ArgumentOutOfRangeException(nameof(maximumPoolSize), ErrorMessages.NegativeOrZeroMaximumPoolSize);

// Throws an exception if the type does not have default constructor - on purpose! We
// could have added a generic constraint with new (), but we did not want to limit the
Expand Down Expand Up @@ -122,7 +121,7 @@ public int MaximumPoolSize
set
{
// Preconditions
Raise.ArgumentOutOfRangeException.If(value < 1, nameof(value), ErrorMessages.NegativeOrZeroMaximumPoolSize);
if (value <= 0) throw new ArgumentOutOfRangeException(nameof(value), ErrorMessages.NegativeOrZeroMaximumPoolSize);

// Resize the pool and destroy exceeding items, if any.
foreach (var exceedingItem in PooledObjects.Resize(value))
Expand Down
4 changes: 2 additions & 2 deletions src/CodeProject.ObjectPool/ParameterizedObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public TValue GetObject(TKey key)

#region Low-level Pooling

#if (NETSTD10 || NETSTD11 || NETSTD12)
#if NETSTD10
private readonly System.Collections.Generic.Dictionary<TKey, ObjectPool<TValue>> _pools = new System.Collections.Generic.Dictionary<TKey, ObjectPool<TValue>>();
#else
private readonly System.Collections.Hashtable _pools = new System.Collections.Hashtable();
Expand All @@ -191,7 +191,7 @@ private void ClearPools()

private bool TryGetPool(TKey key, out ObjectPool<TValue> objectPool)
{
#if (NETSTD10 || NETSTD11 || NETSTD12)
#if NETSTD10
// Dictionary requires locking even for readers.
lock (_pools)
{
Expand Down
2 changes: 1 addition & 1 deletion src/CodeProject.ObjectPool/TimedObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#if !(NETSTD10 || NETSTD11)
#if !NETSTD10

using CodeProject.ObjectPool.Core;
using PommaLabs.Thrower;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.10.3" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="1.1.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="1.2.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.10.8" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="1.1.1" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="1.2.2" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="NLipsum" Version="1.1.0" />
<PackageReference Include="NUnit" Version="3.6.1" />
<PackageReference Include="NUnit" Version="3.7.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.6.1" />
<PackageReference Include="NUnitLite" Version="3.6.1" />
<PackageReference Include="Shouldly" Version="2.8.2" />
<PackageReference Include="NUnitLite" Version="3.7.1" />
<PackageReference Include="Shouldly" Version="2.8.3" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
Expand Down
2 changes: 1 addition & 1 deletion tools/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake" version="0.19.2" />
<package id="Cake" version="0.20.0" />
</packages>

0 comments on commit 327c7b3

Please sign in to comment.