Skip to content

Commit 3055d63

Browse files
committed
Make performant on Windows, while keeping mutexes
1 parent d137c0a commit 3055d63

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

qasync/_windows.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,13 @@ def _poll(self, timeout=None):
140140
if ms >= UINT32_MAX:
141141
raise ValueError("timeout too big")
142142

143-
with QtCore.QMutexLocker(self._lock):
144-
while True:
145-
# self._logger.debug('Polling IOCP with timeout {} ms in thread {}...'.format(
146-
# ms, threading.get_ident()))
147-
status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms)
148-
if status is None:
149-
break
150-
ms = 0
143+
while True:
144+
status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms)
145+
if status is None:
146+
break
147+
ms = 0
151148

149+
with QtCore.QMutexLocker(self._lock):
152150
err, transferred, key, address = status
153151
try:
154152
f, ov, obj, callback = self._cache.pop(address)

0 commit comments

Comments
 (0)