This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Expose LockFile on Windows
Type: enhancement Stage:
Components: Library (Lib), Windows Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, pitrou, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2017-11-19 20:21 by pitrou, last changed 2022-04-11 14:58 by admin.

Messages (1)
msg306514 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-11-19 20:21
msvcrt.locking() is sometimes practically useless since its so-called "non-blocking" mode will still block for 1 second.  Instead, the Windows API LockFile() function (and its companion UnlockFile()) allows real non-blocking locking.

Right now you have to call LockFile() using ctypes (see https://github.com/mwilliamson/locket.py/pull/8/files for an example).  It would be nice to expose it somewhere, for example in msvcrt or another module.
History
Date User Action Args
2022-04-11 14:58:54adminsetgithub: 76257
2017-11-19 20:21:43pitroucreate