Skip to content

namedmutex.py, a simple ctypes wrapper for Win32 named mutexes

Notifications You must be signed in to change notification settings

charxhit/namedmutex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

namedmutex.py, a simple ctypes wrapper for Win32 named mutexes

NamedMutex is a class for using Windows (Win32) named mutexes for system-wide locks. For example, we use these to lock system-wide log files that multiple processes can write to.

This has a similar API to threading.Lock, and can be used with Python's with statement.

For example:

with namedmutex.NamedMutex('get_dir_mutex'):
    latest_dir = get_latest_dir()
    os.rename(latest_dir, latest_dir + '-processing')

See the source code for more info!

About

namedmutex.py, a simple ctypes wrapper for Win32 named mutexes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%