Drop unnecessary mutex lock in .event_mgr()#996
Conversation
|
@Yadunund I did a quick search across the repo for trivial cases like this one, and I believe there is another one: could you check also this one? |
|
@roncapat thanks for catching that too. We can safely get rid of it as GraphCache has a couple different mutexes protecting members |
|
Is this one already ok or is there any pending action needed from myself? :) |
|
Tick the box to add this pull request to the merge queue (same as
|
|
Pulls: #996 |
|
Pulls: #996 |
Description
Closes #991
Is this user-facing behavior change?
Did you use Generative AI?
No
Additional Information
There are two occurrences of such pattern, where an internal
shared_ptr<EventsManager>gets copied and returned to the caller. That smart pointer is initialized once in constructor and never re-assigned to point to a different instance. Hence, protecting its copy with the mutex is unnecessary.