Skip to content

Draft: Remove MWA RecursiveLock

Maik Nijhuis requested to merge remove-recursive-lock into ast-1351-remove-warnings

MWA has a RecursiveLock class without any documentation regarding its purpose. It looks like its purpose is delaying locking the internal mutex until it's (really) needed.

There are several drawbacks to this approach, though:

  • It is error prone: When adjusting the code, one can easily forget acquiring or releasing a lock.
  • It makes the code more complex, for no reason: In the original code, there are only small parts of code outside the lock. Putting those inside the lock should not have significant performance implications.
  • The code performs more locking and unlocking actions than needed, which reduces performance.

Merge request reports