]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blame - helpers/lock.py
Add config file option to the command line
[perso/Immae/Projets/Python/MusicSampler.git] / helpers / lock.py
CommitLineData
ba9ea93a
IB
1import threading
2
3class Lock:
4 def __init__(self, lock_type):
5 self.type = lock_type
6 self.lock = threading.RLock()
7
8 def acquire(self, *args, **kwargs):
9 #print("acquiring lock for {}".format(self.type))
10 self.lock.acquire(*args, **kwargs)
11
12 def release(self, *args, **kwargs):
13 #print("releasing lock for {}".format(self.type))
14 self.lock.release(*args, **kwargs)
15