You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Rabih M <ra...@gmail.com> on 2020/02/14 17:11:25 UTC

[Proton Cpp] container.stop called in a separate thread

Hello,

I am using proton cpp 0.27.1.

While working on the C++ imperative API, I encountered a problem while
using container.stop.
Please find the test code attached (a simplified version of the current
implementation).
I attached the core I am getting too.

The problem:
In the example I attached, the container.stop in the ImperativeContainer
destructor might have a race condition with the closing of the connection.
Is everything related to this connection is freed when on_transport_close
is called? because in the on_transport_close I signal for the main thread
to continue and execute container.stop which might create a race condition
if some actions are taken after on_transport_close is called...

A probable solution:
I think we need a sure way to be able to release a handler:
It might be an unregister handler function or a call back after
on_transport_close that tells us that we can release the memory of the
handler.

Best regards,
Rabih