On Wednesday 22 April 2009 10:33:49 Raphael Coeffic wrote:

Hi,

> I would not mess with signals and threads, as this is not very safe. I
> had some issues with SEMS reacting differently on different linux
> flavors because of a different behavior of signals related with threads.

I didn't mean it like that, I just pressed ^C and noticed that sig_usr_un() 
gets called and it does some housekeeping before calling exit().

> If you want to participate in the shutdown process, the easiest way is
> to register your helper thread at the AmEventDispatcher
> (::addEventQueue(...)).
> All you have to do is inheritate your class from AmEventQueueInterface
> (and of course implement the few virtual methods provided by this
> interface). This way, you will receive an event
> (AmSystemEvent::ServerShutdown) when the system is shut down. Please
> remember to handle this event asynchronously, as the postEvent() method
> would block the caller thread otherwise.

If I do it asynchronously, is it guaranteed that my stuff will finish?

br

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

Reply via email to