Multiclient bug fixed
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using mROA.Abstract;
|
||||
@@ -7,7 +8,7 @@ namespace mROA.Implementation
|
||||
{
|
||||
public class CancellationRepository : ICancellationRepository
|
||||
{
|
||||
private Dictionary<Guid, CancellationTokenSource> _cancellations = new();
|
||||
private ConcurrentDictionary<Guid, CancellationTokenSource> _cancellations = new();
|
||||
|
||||
public void RegisterCancellation(Guid id, CancellationTokenSource cts)
|
||||
{
|
||||
@@ -16,12 +17,12 @@ namespace mROA.Implementation
|
||||
|
||||
public CancellationTokenSource? GetCancellation(Guid id)
|
||||
{
|
||||
return _cancellations.GetValueOrDefault(id, null);
|
||||
return _cancellations.GetValueOrDefault(id);
|
||||
}
|
||||
|
||||
public void FreeCancelation(Guid id)
|
||||
{
|
||||
_cancellations.Remove(id);
|
||||
_cancellations.Remove(id, out _);
|
||||
}
|
||||
|
||||
public void Inject<T>(T dependency)
|
||||
|
||||
Reference in New Issue
Block a user