Skip to content

Commit

Permalink
Fixes #356 An item with the same key has already been added exception
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-luberda committed Nov 3, 2016
1 parent 6459ac4 commit 57c769d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions source/FFImageLoading.Common/Work/WorkScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,16 +392,13 @@ protected async Task RunImageLoadingTaskAsync(PendingTask pendingTask, bool sche
{
if (RunningTasks.ContainsKey(key))
return;

RunningTasks.Add(key, pendingTask);
Interlocked.Increment(ref _statsTotalRunning);
}

try
{
lock (_pendingTasksLock)
{
RunningTasks.Add(key, pendingTask);
Interlocked.Increment(ref _statsTotalRunning);
}

if (Configuration.VerbosePerformanceLogging)
{
Stopwatch stopwatch = Stopwatch.StartNew();
Expand Down

0 comments on commit 57c769d

Please sign in to comment.