Raphael Coeffic wrote:
If I do it asynchronously, is it guaranteed that my stuff will finish?


Yes. All you have to do is to remove your helper thread from the AmEventDispatcher at last. A quick look at AmSessionContainer::on_stop() will convince you for sure ;-)

The only issue would be that you have to clean the memory as well. The memory for the sessions get cleaned by AmSessionContainer. In your case, you could use AmThreadWatcher (AmThread.h). It implements a garbage collector that deletes your instance as soon as it is stopped (+ some delay, because the garbage collector only runs every 10 seconds).


Hooops! I just looked at the code, and following issue raised: AmThreadWatcher is not included in the shutdown process. This means that there will be a race condition between you thread beeing cleaned up and the death of the process. If you can live with this, then go ahead!

-Raphael.
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to