Closed svlad-90 closed 5 years ago
Yes you are right, this could be a problem. The Indexing thread was long time after the plugin interface definition.
Yes we should add some comments here. The plugins must handle this use case with some mutex.
If you can provide a patch would be create.
Hi @alexmucde, this issue can be closed as with the following commit I've already added the requested comments:
Already fixed.
The following 2 lines are called from within the dltfileindexerthread, which is not an owner of the plugins:
https://github.com/GENIVI/dlt-viewer/blob/master/src/dltfileindexerthread.cpp#L113 https://github.com/GENIVI/dlt-viewer/blob/master/src/dltfileindexerthread.cpp#L143
That leads to a race condition, if a plugin modifies its state in GUI thread simultaneously with these calls.
The way around, which I've applied to my plugin was:
Please, either add comment to the mentioned methods regarding in which thread they are called, or add implicit transfer to the correct thread before making a call.