diff options
Diffstat (limited to 'indra/llcommon/llapp.h')
-rw-r--r-- | indra/llcommon/llapp.h | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index f8a593c33d..cc60ba0b80 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -40,8 +40,7 @@ // Forward declarations class LLErrorThread; -class LLApp; - +class LLLiveFile; typedef void (*LLAppErrorHandler)(); typedef void (*LLAppChildCallback)(int pid, bool exited, int status); @@ -128,6 +127,19 @@ public: bool parseCommandOptions(int argc, char** argv); /** + * @brief Keep track of live files automatically. + * + * *TODO: it currently uses the <code>addToEventTimer()</code> API + * instead of the runner. I should probalby use the runner. + * + * *NOTE: DO NOT add the livefile instance to any kind of check loop. + * + * @param livefile A valid instance of an LLLiveFile. This LLApp + * instance will delete the livefile instance. + */ + void manageLiveFile(LLLiveFile* livefile); + + /** * @brief Set the options at the specified priority. * * This function completely replaces the options at the priority @@ -194,11 +206,26 @@ public: #endif static int getPid(); - // - // Error handling methods - // + /** @name Error handling methods */ + //@{ + /** + * @brief Do our generic platform-specific error-handling setup -- + * signals on unix, structured exceptions on windows. + * + * DO call this method if your app will either spawn children or be + * spawned by a launcher. + * Call just after app object construction. + * (Otherwise your app will crash when getting signals, + * and will not core dump.) + * + * DO NOT call this method if your application has specialized + * error handling code. + */ + void setupErrorHandling(); + void setErrorHandler(LLAppErrorHandler handler); void setSyncErrorHandler(LLAppErrorHandler handler); + //@} #if !LL_WINDOWS // @@ -214,8 +241,9 @@ public: void setDefaultChildCallback(LLAppChildCallback callback); // Fork and do the proper signal handling/error handling mojo - // WARNING: You need to make sure your signal handling callback is correct after - // you fork, because not all threads are duplicated when you fork! + // *NOTE: You need to make sure your signal handling callback is + // correct after you fork, because not all threads are duplicated + // when you fork! pid_t fork(); #endif @@ -255,7 +283,6 @@ protected: private: void startErrorThread(); - void setupErrorHandling(); // Do platform-specific error-handling setup (signals, structured exceptions) static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. static void runSyncErrorHandler(); // run IMMEDIATELY when we get an error, ran in the context of the faulting thread. @@ -278,6 +305,8 @@ private: // The application options. LLSD mOptions; + // The live files for this application + std::vector<LLLiveFile*> mLiveFiles; //@} private: |