Issue 32076: Expose LockFile on Windows (original) (raw)

Issue32076

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:54 admin set github: 76257
2017-11-19 20:21:43 pitrou create