File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -260,17 +260,19 @@ public void ServiceRegistration_SingletonByThread()
260260 }
261261
262262 [ TestMethod ]
263- public async Task ServiceRegistration_SingletonByThread_Simple ( )
263+ public void ServiceRegistration_SingletonByThread_Simple ( )
264264 {
265265 var service_manager = new ServiceManager ( ) ;
266266
267267 service_manager . Register < Service_GetHashCode > ( ServiceRegistrationMode . SingleThread ) ;
268268
269269 var instance = service_manager . Get < Service_GetHashCode > ( ) ;
270270
271- await Task . Yield ( ) . ConfigureAwait ( false ) ;
271+ Service_GetHashCode ? instance2 = null ;
272272
273- var instance2 = service_manager . Get < Service_GetHashCode > ( ) ;
273+ var get_service_thread = new Thread ( ( ) => instance2 = service_manager . Get < Service_GetHashCode > ( ) ) ;
274+ get_service_thread . Start ( ) ;
275+ get_service_thread . Join ( ) ;
274276
275277 Assert . IsNotNull ( instance2 ) ;
276278 var is_same = ReferenceEquals ( instance , instance2 ) ;
You can’t perform that action at this time.
0 commit comments