]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - helpers/__init__.py
enhancing locks
[perso/Immae/Projets/Python/MusicSampler.git] / helpers / __init__.py
index 6935342cc34a74f0304f4bd83bb42a335a7a1cb2..b1723ee8e51c169ef5ccd922169a0e4ecefb6340 100644 (file)
@@ -1,12 +1,10 @@
 # -*- coding: utf-8 -*-
-import threading
 from .music_file import *
 from .mapping import *
-
-draw_lock = threading.RLock()
+from .lock import *
+import yaml
 
 def parse_config(mapping):
-    import yaml
     stream = open("config.yml", "r")
     config = yaml.load(stream)
     stream.close()
@@ -14,7 +12,7 @@ def parse_config(mapping):
     aliases = config['aliases']
     seen_files = {}
 
-    file_lock = threading.RLock()
+    file_lock = Lock("file")
 
     for mapped_key in config['keys']:
         key = mapping.find_by_unicode(mapped_key)