Bolt receiver support patch
I am creating this PR on behalf of @xinix00 in issue #402.
This patch fixes an issue where connecting to a device through the bolt receiver failed. This patch fixes issue #402, #388 and #385. Multiple people have been affected and have been helped by that fix. Hope this can be applied to all.
@PixlOne any chance on getting this merged?
I really hope this gets merged soon, It is really annoying having to turn off and back on every time
I guess the problem here is that the patch looks wrong: The lock is supposed to protect modifications to the _waiters, and on the surface it does do that -- all places touching _waiters now first acquire that lock.
This smells like the mutex here should be reentrant (i.e. be a std::recursive_mutex and not just std::mutex), but I don't know the code base well enough to see the path that would require that.