Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benhoyt/namedmutex
namedmutex.py, a simple ctypes wrapper for Win32 named mutexes
https://github.com/benhoyt/namedmutex
Last synced: 29 days ago
JSON representation
namedmutex.py, a simple ctypes wrapper for Win32 named mutexes
- Host: GitHub
- URL: https://github.com/benhoyt/namedmutex
- Owner: benhoyt
- Created: 2012-10-04T03:07:50.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2022-08-24T22:05:25.000Z (about 2 years ago)
- Last Synced: 2024-06-15T06:42:57.655Z (5 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 15
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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:
```python
with namedmutex.NamedMutex('get_dir_mutex'):
latest_dir = get_latest_dir()
os.rename(latest_dir, latest_dir + '-processing')
```See the [source code](https://github.com/benhoyt/namedmutex/blob/master/namedmutex.py)
for more info!