gdesk.utils.namedmutex module

Named mutex handling (for Win32).

See README.md or https://github.com/benhoyt/namedmutex for a bit more documentation.

This code is released under the new BSD 3-clause license: http://opensource.org/licenses/BSD-3-Clause

class gdesk.utils.namedmutex.NamedMutex(name, acquired=False)

Bases: object

A named, system-wide mutex that can be acquired and released.

acquire(timeout=None)

Acquire ownership of the mutex, returning True if acquired. If a timeout is specified, it will wait a maximum of timeout seconds to acquire the mutex, returning True if acquired, False on timeout. Raises WindowsError on error.

close()

Close the mutex and release the handle.

release()

Relase an acquired mutex. Raises WindowsError on error.