imiptools/content.py | raw changeset files shortlog |
1.1 --- a/imiptools/content.py Sat Sep 12 19:58:59 2015 +0200 1.2 +++ b/imiptools/content.py Sat Sep 12 20:16:38 2015 +0200 1.3 @@ -72,7 +72,14 @@ 1.4 handler.set_identity(method) 1.5 1.6 if handler.is_usable(method): 1.7 - methods[method](handler)() 1.8 + 1.9 + # Perform the method in a critical section. 1.10 + 1.11 + handler.acquire_lock() 1.12 + try: 1.13 + methods[method](handler)() 1.14 + finally: 1.15 + handler.release_lock() 1.16 1.17 # Handler registry. 1.18