Derives one atomic lock from two nonatomic lockfiles with temporary content. Suitable for use across containers. Be sure to use a filename that is visible across all relevant containers. If you run: fsock = fslock_mod.Fslock('/mnt/lockfile') ...then it will use /mnt/lockfile.1 and /mnt/lockfile.2 Tested and works on CPython 3.3-3.7, CPython 2.7, pypy2 7.1.1 and pypy3 7.0.0. Does not work on Micropython 1.11. Threading support attempted, but not tested at all. ----- It's remarkable how well this does, but I'm not 100% sure it's atomic. I've tested it a lot, but without Fslock.release(force=True), it gets confused under load - that is, just Fslock.release() fails. Somehow being Less cautious works fine.