The getStubFunctor_ returns a reference to the value to be serialized. This reference is protected by the critical section of the mutex.
However, by unlocking the mutex before the serialization isn´t there the possibility of the value being changed unintentionally, even if the user locks the mutex first?
If the user even goes so far as to delete the object, the serialization would cause UB right?
The
getStubFunctor_
returns a reference to the value to be serialized. This reference is protected by the critical section of the mutex. However, by unlocking the mutex before the serialization isn´t there the possibility of the value being changed unintentionally, even if the user locks the mutex first? If the user even goes so far as to delete the object, the serialization would cause UB right?https://github.com/GENIVI/capicxx-someip-runtime/blob/0ad2bdc1807fc0f078b9f9368a47ff2f3366ed13/include/CommonAPI/SomeIP/StubAdapterHelper.hpp#L856-L863
Why not unlock it after the
outputStream << deployable;
?