harlowja / fasteners

A python package that provides useful locks.
Apache License 2.0
246 stars 45 forks source link

Getting the PID of the locking process in InterProcessLock #47

Open samschott opened 4 years ago

samschott commented 4 years ago

Have you ever considered extending the functionality of InterProcessLock to retrieve the PID of the currently locking process? Python does not seem to implement this in the fcntl module but one could use F_GETLK directly and pass the appropriate structure for the platform. An example of how to build such structures for different platforms can be found in the cpython tests.