Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d85deb7c
Commit
d85deb7c
authored
Nov 24, 2013
by
Richard Oudkerk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19740: Use WaitForSingleObject() instead of trusting TimerOrWaitFired.
parent
8461daae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Lib/asyncio/windows_events.py
Lib/asyncio/windows_events.py
+9
-2
No files found.
Lib/asyncio/windows_events.py
View file @
d85deb7c
...
...
@@ -327,14 +327,21 @@ class IocpProactor:
handle
,
self
.
_iocp
,
ov
.
address
,
ms
)
f
=
_WaitHandleFuture
(
wh
,
loop
=
self
.
_loop
)
def
finish
(
t
imed_out
,
_
,
ov
):
def
finish
(
t
rans
,
key
,
ov
):
if
not
f
.
cancelled
():
try
:
_overlapped
.
UnregisterWait
(
wh
)
except
OSError
as
e
:
if
e
.
winerror
!=
_overlapped
.
ERROR_IO_PENDING
:
raise
return
not
timed_out
# Note that this second wait means that we should only use
# this with handles types where a successful wait has no
# effect. So events or processes are all right, but locks
# or semaphores are not. Also note if the handle is
# signalled and then quickly reset, then we may return
# False even though we have not timed out.
return
(
_winapi
.
WaitForSingleObject
(
handle
,
0
)
==
_winapi
.
WAIT_OBJECT_0
)
self
.
_cache
[
ov
.
address
]
=
(
f
,
ov
,
None
,
finish
)
return
f
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment