Fix multi threading by using const ref to function

Merged Martin Schneider requested to merge fix/multithreading-temp into master

Try to fix issue with multithreading

Merge request reports