overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
127 stars 47 forks source link

Lock related warnings in RecordingScriptingInterface.cpp #1005

Closed daleglass closed 2 weeks ago

daleglass commented 2 weeks ago
/home/dale/git/overte/libraries/recording/src/recording/RecordingScriptingInterface.cpp:41:11: warning: unnecessary parentheses in declaration of ‘_mutex’ [-Wparentheses]
   41 |     Locker(_mutex);
      |           ^~~~~~~~

I'm a bit confused about what's going on here. Locker works out to std::unique_lock<Mutex>;

Shouldn't we be using std::lock_guard guard(_mutex) here?

HifiExperiments commented 2 weeks ago

I think it needs to be ‘Locker lock(_mutex)’ and the mutex needs to be mutable. I will include this in a follow up PR for a bunch of the remaining warnings