File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ namespace Remote.Linq.Tests;
10
10
using System . Collections . Generic ;
11
11
using System . Globalization ;
12
12
using System . Linq ;
13
+ using System . Threading ;
13
14
using System . Threading . Tasks ;
14
15
using Xunit . Sdk ;
15
16
using MethodInfo = System . Reflection . MethodInfo ;
@@ -84,17 +85,20 @@ public static bool IsCollection(this Type type)
84
85
85
86
private sealed class CultureContext : IDisposable
86
87
{
88
+ private static readonly SemaphoreSlim _semaphore = new ( 1 , 1 ) ;
87
89
private readonly CultureInfo _culture ;
88
90
89
91
public CultureContext ( CultureInfo culture )
90
92
{
93
+ _semaphore . Wait ( ) ;
91
94
_culture = CultureInfo . CurrentCulture ;
92
95
CultureInfo . CurrentCulture = culture ;
93
96
}
94
97
95
98
public void Dispose ( )
96
99
{
97
100
CultureInfo . CurrentCulture = _culture ;
101
+ _semaphore . Release ( ) ;
98
102
}
99
103
}
100
104
You can’t perform that action at this time.
0 commit comments