bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Request: Callback when GNU APL shuts down


From: Juergen Sauermann
Subject: Re: [Bug-apl] Request: Callback when GNU APL shuts down
Date: Sat, 25 Jan 2014 18:37:17 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5

Hi,

I have added support for a function close_fun(Cause cause);

If your library provides a function with that name (via get_function_mux())
then it will be called before dlclose() is called. No need to register it.

/// Jürgen


On 01/24/2014 04:22 AM, Elias Mårtenson wrote:
Is there a "correct" way to get informed when the interpreter is shutting down? In my case, I need to do some cleanup (in particular, delete the Unix domain socket file) when the interpreter exits.

One hypothetical implementation would involve something like the following function being exposed to plugins:

void register_shutdown_callback( void (*callback)(Type type) );

I could then call this function to register a function that is called whenever the interpreter is about to be stopped. I envision the type argument to inform me as to the type of shutdown (by a INT or HUP signal, a call to )OFF, or a crash, for example).

Would this be possible?

Regards,
Elias


reply via email to

[Prev in Thread] Current Thread [Next in Thread]