We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8742ca commit 19064faCopy full SHA for 19064fa
narps_open/utils/singleton.py
@@ -19,8 +19,9 @@ class SingletonMeta(type):
19
20
def __call__(cls, *args, **kwargs):
21
""" Creating only one instance for the class 'cls' """
22
- with cls._lock:
23
- if cls not in cls._instances:
+ if cls not in cls._instances:
+ with cls._lock:
24
instance = super().__call__(*args, **kwargs)
25
cls._instances[cls] = instance
26
+
27
return cls._instances[cls]
0 commit comments