Directory: fix concurreny issue
If more than one thread would call _get_plugin_directory at the same time and there was no plugin created then this may lead to a race and each thread may have a different list of plugin data. Change-Id: Id5d23f06e5f59fc07b660ef6c23cacf8cde1b999
This commit is contained in:
@@ -66,7 +66,8 @@ _PLUGIN_DIRECTORY = None
|
||||
@_synchronized("plugin-directory")
|
||||
def _create_plugin_directory():
|
||||
global _PLUGIN_DIRECTORY
|
||||
_PLUGIN_DIRECTORY = _PluginDirectory()
|
||||
if _PLUGIN_DIRECTORY is None:
|
||||
_PLUGIN_DIRECTORY = _PluginDirectory()
|
||||
return _PLUGIN_DIRECTORY
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user