Repository navigation
Add a mutex for shared Inference Engine plugins - #13738
Conversation
| #endif // IE < R5 | ||
|
|
||
| static Mutex sharedPluginsMutex; | ||
| static std::map<InferenceEngine::TargetDevice, InferenceEngine::InferenceEnginePluginPtr> sharedPlugins; |
There was a problem hiding this comment.
It is better to wrap global "static" variables into static functions (to ensure initialization of them at least).
There was a problem hiding this comment.
@alalek, Is that Ok to use a mutex from getInitializationMutex()?
opencv/modules/dnn/src/init.cpp
Lines 52 to 57 in e82e672
There was a problem hiding this comment.
I believe you can reuse it (declared in dnn's precomp.hpp).
21cc489 to
38346d3
Compare
|
|
||
| #ifdef HAVE_INF_ENGINE | ||
| #include <thread> | ||
| #endif |
There was a problem hiding this comment.
Please keep "test_precomp.hpp" as the first "include" statement.
38346d3 to
bc4e471
Compare
|
|
||
| try | ||
| { | ||
| AutoLock lock(getInitializationMutex()); |
There was a problem hiding this comment.
@shahzadlone, thanks for review! Could you please clarify it a bit?
There was a problem hiding this comment.
if lock isn't being modified could it perhaps be made const AutoLock?
There was a problem hiding this comment.
This change doesn't fix (or change) anything in current code.
@shahzadlone Please report about real issues only.
Avoid reporting about "const" of local variables. They are usually not required and can be safely omitted (compilers are smart enough).
It make sense to report about "const" in parameters or about "const methods".
resolves #13715
resolves #13569