mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #16640: Run less code under a lock in sched module.
This commit is contained in:
parent
1147f82438
commit
d07db96ab6
2 changed files with 7 additions and 6 deletions
|
@ -71,8 +71,8 @@ class scheduler:
|
|||
"""
|
||||
if kwargs is _sentinel:
|
||||
kwargs = {}
|
||||
with self._lock:
|
||||
event = Event(time, priority, action, argument, kwargs)
|
||||
with self._lock:
|
||||
heapq.heappush(self._queue, event)
|
||||
return event # The ID
|
||||
|
||||
|
@ -82,7 +82,6 @@ class scheduler:
|
|||
This is actually the more commonly used interface.
|
||||
|
||||
"""
|
||||
with self._lock:
|
||||
time = self.timefunc() + delay
|
||||
return self.enterabs(time, priority, action, argument, kwargs)
|
||||
|
||||
|
|
|
@ -200,6 +200,8 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- Issue #16640: Run less code under a lock in sched module.
|
||||
|
||||
- Issue #16165: Fix sched.scheduler.run() method was block a scheduler for
|
||||
other threads.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue