mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Use Queue's blocking feature instead of sleeping in the main
loop. Patch # 1190163 Michiel de Hoon
This commit is contained in:
parent
abb103b17a
commit
20345fb8aa
2 changed files with 4 additions and 2 deletions
|
@ -82,9 +82,8 @@ def main(del_exitfunc=False):
|
|||
# exiting but got an extra KBI? Try again!
|
||||
continue
|
||||
try:
|
||||
seq, request = rpc.request_queue.get(0)
|
||||
seq, request = rpc.request_queue.get(block=True, timeout=0.05)
|
||||
except Queue.Empty:
|
||||
time.sleep(0.05)
|
||||
continue
|
||||
method, args, kwargs = request
|
||||
ret = method(*args, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue