File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -458,28 +458,28 @@ async def acquire(self) -> bool:
458
458
fut = create_sub_future ()
459
459
self ._waiters .append (fut )
460
460
461
- try :
462
461
try :
462
+ try :
463
463
464
- def aaa (fut : asyncio .Future [Any ]) -> None :
465
- warnings .warn (f"Lock { self } takes to long { threading .current_thread ()} \n , try to cancel..." )
466
- fut .cancel ()
464
+ def aaa (fut : asyncio .Future [Any ]) -> None :
465
+ warnings .warn (f"Lock { self } takes to long { threading .current_thread ()} \n , try to cancel..." )
466
+ fut .cancel ()
467
467
468
- h = fut .get_loop ().call_later (120 , aaa , fut )
469
- try :
470
- await fut
468
+ h = fut .get_loop ().call_later (120 , aaa , fut )
469
+ try :
470
+ await fut
471
+ finally :
472
+ h .cancel ()
471
473
finally :
472
- h .cancel ()
473
- finally :
474
- with self ._lock :
475
- self ._waiters .remove (fut )
476
- except asyncio .CancelledError :
477
- with self ._lock :
474
+ with self ._lock :
475
+ self ._waiters .remove (fut )
476
+ except asyncio .CancelledError :
477
+ # with self._lock:
478
478
if not self ._locked :
479
479
self ._wake_up_first ()
480
480
raise
481
481
482
- with self ._lock :
482
+ # with self._lock:
483
483
self ._locked = True
484
484
self ._locker = asyncio .current_task ()
485
485
You can’t perform that action at this time.
0 commit comments