File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ # Copyright 2020-present Michael Hall
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
115import asyncio
216import random
317import time
@@ -20,8 +34,10 @@ async def amain():
2034 with (
2135 threaded_loop (use_eager_task_factory = False ) as tl1 ,
2236 threaded_loop (use_eager_task_factory = False ) as tl2 ,
37+ threaded_loop () as tl3 ,
38+ threaded_loop () as tl4 ,
2339 ):
24- tsks = {loop .run (check (lock )) for loop in (tl1 , tl2 ) for _ in range (10 )}
40+ tsks = {loop .run (check (lock )) for loop in (tl1 , tl2 , tl3 , tl4 ) for _ in range (10 )}
2541 await asyncio .gather (* tsks )
2642
2743
You can’t perform that action at this time.
0 commit comments