Skip to content

Commit

Permalink
Thread safe list clean
Browse files Browse the repository at this point in the history
  • Loading branch information
jbogard committed May 29, 2015
1 parent f168b91 commit b1ca7f9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/AutoMapper/ThreadSafeList.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using AutoMapper.Internal;

namespace AutoMapper
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Internal;

public class ThreadSafeList<T> : IEnumerable<T>, IDisposable
where T : class
{
Expand Down Expand Up @@ -57,7 +57,6 @@ public T GetOrCreate(Predicate<T> predicate, Func<T> creatorFunc)
{
_lock.ExitUpgradeableReadLock();
}

}

public void Clear()
Expand Down Expand Up @@ -108,8 +107,7 @@ protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (_lock != null)
_lock.Dispose();
_lock?.Dispose();
}

_lock = null;
Expand Down

0 comments on commit b1ca7f9

Please sign in to comment.