Changeset 298:24c67ec5cdca for src/mlx/singleton.py
- Timestamp:
- 07/21/12 12:43:34 (12 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/singleton.py
r247 r298 1 # Module to allow for a single instance of an application to run2 1 3 2 import os 4 3 import time 4 5 #---------------------------------------------------------------------------- 6 7 ## @package mlx.singleton 8 # 9 # Allow a single instance of an application to run. 10 # 11 # This module implements the logic needed to detect that an instance of the 12 # application is already running, and if so, notifying that instance. 13 # 14 # On Windows, a mutex is used to ensure that only a single instance is running, 15 # since a mutex with a certain name can be created by one process only. If the 16 # current process is the only instance, a named pipe is created and a thread is 17 # started to listen for messages. Otherwise a message is sent to that pipe, 18 # which results in calling a callback function. 19 # 20 # On Linux a Unix socket is created protected by a lock file, and the messages 21 # from other instances are received via this socket. 22 # 23 # The main window is raised if another instance is started. 5 24 6 25 #----------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.