Skip to content

Commit a05b56c

Browse files
committed
Refactoring calls sync
1 parent f71c108 commit a05b56c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Mapster/TypeAdapterConfig.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,10 @@ public Func<TSource, TDestination> GetMapFunction<TSource, TDestination>()
337337
}
338338
internal Delegate GetMapFunction(Type sourceType, Type destinationType)
339339
{
340-
ConfigureSync.WaitOne(-1);
340+
ConfigureSync.WaitOne();
341341

342342
if (IsScanConcurrency)
343-
ApplySync.WaitOne(-1);
343+
ApplySync.WaitOne();
344344
try
345345
{
346346
var key = new TypeTuple(sourceType, destinationType);
@@ -362,10 +362,10 @@ public Func<TSource, TDestination, TDestination> GetMapToTargetFunction<TSource,
362362
}
363363
internal Delegate GetMapToTargetFunction(Type sourceType, Type destinationType)
364364
{
365-
ConfigureSync.WaitOne(-1);
365+
ConfigureSync.WaitOne();
366366

367367
if (IsScanConcurrency)
368-
ApplySync.WaitOne(-1);
368+
ApplySync.WaitOne();
369369

370370
try
371371
{
@@ -391,10 +391,10 @@ internal Expression<Func<TSource, TDestination>> GetProjectionExpression<TSource
391391
}
392392
internal MethodCallExpression GetProjectionCallExpression(Type sourceType, Type destinationType)
393393
{
394-
ConfigureSync.WaitOne(-1);
394+
ConfigureSync.WaitOne();
395395

396396
if (IsScanConcurrency)
397-
ApplySync.WaitOne(-1);
397+
ApplySync.WaitOne();
398398

399399
try
400400
{
@@ -413,7 +413,7 @@ internal MethodCallExpression GetProjectionCallExpression(Type sourceType, Type
413413
private readonly ConcurrentDictionary<TypeTuple, Delegate> _dynamicMapDict = new ConcurrentDictionary<TypeTuple, Delegate>();
414414
public Func<object, TDestination> GetDynamicMapFunction<TDestination>(Type sourceType)
415415
{
416-
ConfigureSync.WaitOne(-1);
416+
ConfigureSync.WaitOne();
417417

418418
if (IsScanConcurrency)
419419
ApplySync.WaitOne(-1);
@@ -808,7 +808,7 @@ public IList<IRegister> Scan(params Assembly[] assemblies)
808808

809809
public IList<IRegister> ScanConcurrency(params Assembly[] assemblies)
810810
{
811-
ConfigureSync.WaitOne(-1);
811+
ConfigureSync.WaitOne();
812812
IsScanConcurrency = true;
813813

814814
try
@@ -837,7 +837,7 @@ public void Apply(IEnumerable<Lazy<IRegister>> registers)
837837
/// <param name="registers">collection of IRegister interface to apply mapping.</param>
838838
public void Apply(IEnumerable<IRegister> registers)
839839
{
840-
ApplySync.WaitOne(-1, false);
840+
ApplySync.WaitOne();
841841

842842
foreach (IRegister register in registers)
843843
{
@@ -975,7 +975,7 @@ public static void NewConfig(Action<TypeAdapterSetter<TSource, TDestination>> cf
975975
{
976976
var config = TypeAdapterConfig.GlobalSettings;
977977

978-
config.ConfigureSync.WaitOne(-1, false);
978+
config.ConfigureSync.WaitOne();
979979

980980
try
981981
{

0 commit comments

Comments
 (0)