Le nom du lock peut tre overrid
darcs-hash:20041212121735-d1718-7e99a17be609bcf6637d11b03afe6a7787d5a643.gz
This commit is contained in:
parent
ab52211b22
commit
bab694df52
1 changed files with 6 additions and 2 deletions
|
@ -33,16 +33,20 @@ class gen_config :
|
|||
debug = 0
|
||||
_locked = 0
|
||||
__restore={} # pour restorer la config d'origine en cas d'erreur de génération
|
||||
|
||||
def lockname(self):
|
||||
"""Nom du lock"""
|
||||
return str(self.__class__)
|
||||
|
||||
def lock(self) :
|
||||
""" Lock le service courant """
|
||||
if not self._locked :
|
||||
make_lock(str(self.__class__),'')
|
||||
make_lock(self.lockname(),'')
|
||||
self._locked = 1
|
||||
|
||||
def unlock(self) :
|
||||
""" Supression du lock """
|
||||
if self._locked : remove_lock(str(self.__class__))
|
||||
if self._locked : remove_lock(self.lockname())
|
||||
|
||||
def __del__(self) :
|
||||
# Au cas où...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue