[pywin32-checkins] /hgroot/pywin32/pywin32: Release thread lock in transacted opera...
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2015-04-13 16:54:48
|
changeset b57d0d7444fb in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=b57d0d7444fb summary: Release thread lock in transacted operations diffstat: win32/src/win32file.i | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diffs (49 lines): diff -r 4e527a8f8266 -r b57d0d7444fb win32/src/win32file.i --- a/win32/src/win32file.i Mon Apr 13 10:43:40 2015 -0400 +++ b/win32/src/win32file.i Mon Apr 13 12:53:59 2015 -0400 @@ -4542,12 +4542,14 @@ if (!PyWinObject_AsWCHAR(obfilename, &filename, FALSE)) return NULL; + Py_BEGIN_ALLOW_THREADS if (htransaction) hret=(*pfnCreateFileTransacted)(filename, desiredaccess, sharemode, psa, creationdisposition, flags, htemplate, htransaction, pminiversion, extendedparameter); else hret=CreateFileW(filename, desiredaccess, sharemode, psa, creationdisposition, flags, htemplate); + Py_END_ALLOW_THREADS PyWinObject_FreeWCHAR(filename); if (hret==INVALID_HANDLE_VALUE) @@ -4580,10 +4582,13 @@ return NULL; BOOL ret; + Py_BEGIN_ALLOW_THREADS if (htransaction) ret=(*pfnDeleteFileTransacted)(filename, htransaction); else ret=DeleteFileW(filename); + Py_END_ALLOW_THREADS + PyWinObject_FreeWCHAR(filename); if (!ret) return PyWin_SetAPIError("DeleteFileW"); @@ -4698,6 +4703,8 @@ PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes", bufsize); goto done; } + + Py_BEGIN_ALLOW_THREADS // MSDN docs say this returns a DWORD containing the attributes, but it actually acts as a boolean if (htrans){ if (bUnicode) @@ -4711,6 +4718,7 @@ else ok=GetFileAttributesExA(cname, lvl, buf); } + Py_END_ALLOW_THREADS if (!ok) PyWin_SetAPIError("GetFileAttributesEx"); |