[Stackless-checkins] r52323 - stackless/sandbox/libraries/slpmonkeypatch/resources/iocp.py
richard.tew
python-checkins at python.org
Thu Oct 12 23:35:37 CEST 2006
Author: richard.tew
Date: Thu Oct 12 23:35:35 2006
New Revision: 52323
Modified:
stackless/sandbox/libraries/slpmonkeypatch/resources/iocp.py
Log:
Minor changes, which do not seem to solve the problem anyway.
Modified: stackless/sandbox/libraries/slpmonkeypatch/resources/iocp.py
==============================================================================
--- stackless/sandbox/libraries/slpmonkeypatch/resources/iocp.py (original)
+++ stackless/sandbox/libraries/slpmonkeypatch/resources/iocp.py Thu Oct 12 23:35:35 2006
@@ -47,8 +47,6 @@
_anonymous_ = ("u",)
-OVERLAPPED_POINTER = POINTER(POINTER(OVERLAPPED))
-
# ----------------------------------------------------------------------------
# Windows kernel32 API
@@ -58,15 +56,15 @@
CreateIoCompletionPort.restype = HANDLE
GetQueuedCompletionStatus = windll.kernel32.GetQueuedCompletionStatus
-GetQueuedCompletionStatus.argtypes = (HANDLE, POINTER(DWORD), POINTER(c_ulong), OVERLAPPED_POINTER, DWORD)
+GetQueuedCompletionStatus.argtypes = (HANDLE, POINTER(DWORD), POINTER(c_ulong), POINTER(POINTER(OVERLAPPED)), DWORD)
GetQueuedCompletionStatus.restype = BOOL
ReadFile = windll.kernel32.ReadFile
-ReadFile.argtypes = (HANDLE, c_void_p, DWORD, POINTER(DWORD), OVERLAPPED_POINTER)
+ReadFile.argtypes = (HANDLE, c_void_p, DWORD, POINTER(DWORD), POINTER(OVERLAPPED))
ReadFile.restype = BOOL
WriteFile = windll.kernel32.WriteFile
-WriteFile.argtypes = (HANDLE, c_void_p, DWORD, POINTER(DWORD), OVERLAPPED_POINTER)
+WriteFile.argtypes = (HANDLE, c_void_p, DWORD, POINTER(DWORD), POINTER(OVERLAPPED))
WriteFile.restype = BOOL
CreateFileA = windll.kernel32.CreateFileA
@@ -126,8 +124,8 @@
break
# Should cancel these I guess.
- for ov, c, f in self.overlappedByID.itervalues():
- pass
+ #for ov, c, f in self.overlappedByID.itervalues():
+ # pass
windll.kernel32.CloseHandle(self.handle)
@@ -152,9 +150,9 @@
else:
print "got bs channel in poll", ov
- def HoldOverlappedReference(self, ov, c, f):
- print id(self), "HoldOverlappedReference", ov, c, f
- self.overlappedByID[id(ov)] = ov, c, f
+ def HoldOverlappedReference(self, ov, c):
+ print id(self), "HoldOverlappedReference", ov, c
+ self.overlappedByID[id(ov)] = ov, c
def ForgetOverlappedReference(self, ov):
ovID = id(ov)
@@ -254,14 +252,13 @@
ov = OVERLAPPED()
ov.Offset = self.offset
c = ov.channel = stackless.channel()
- ovp = pointer(ov)
CreateIoCompletionPort(self.handle, iocpMgr.handle, NULL, iocpMgr.numThreads)
- ret = ReadFile(self.handle, readBufferPtr, size, byref(readBytes), byref(ovp))
+ ret = ReadFile(self.handle, readBufferPtr, size, byref(readBytes), byref(ov))
if ret == 0:
if windll.kernel32.GetLastError() != ERROR_IO_PENDING:
raise WinError()
- iocpMgr.HoldOverlappedReference(ov, c, readBuffer)
+ iocpMgr.HoldOverlappedReference(ov, c)
print "blocking pre"
c.receive()
print "blocking post"
_______________________________________________
Stackless-checkins mailing list
Stackless-checkins at stackless.com
http://www.stackless.com/mailman/listinfo/stackless-checkins
More information about the Stackless-checkins
mailing list