Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 1 | #ifndef AOS_LINUX_CODE_INIT_H_ |
| 2 | #define AOS_LINUX_CODE_INIT_H_ |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 3 | |
| 4 | namespace aos { |
| 5 | |
Brian Silverman | 6da0427 | 2014-05-18 18:47:48 -0700 | [diff] [blame] | 6 | // In order to use shared memory, one of the Init* functions must be called in |
| 7 | // exactly 1 thread per process. It is OK to keep going without calling one of |
| 8 | // them again after fork(2)ing. |
| 9 | |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 10 | // Does the non-realtime parts of the initialization process. |
| 11 | void InitNRT(); |
| 12 | // Initializes everything, including the realtime stuff. |
Brian Silverman | f3cfbd7 | 2013-10-28 16:26:09 -0700 | [diff] [blame] | 13 | // relative_priority adjusts the priority of this process relative to all of the |
| 14 | // other ones (positive for higher priority). |
| 15 | void Init(int relative_priority = 0); |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 16 | // Same as InitNRT, except will remove an existing shared memory file and create |
| 17 | // a new one. |
| 18 | void InitCreate(); |
| 19 | // Cleans up (probably not going to get called very often because few things can |
| 20 | // exit gracefully). |
| 21 | void Cleanup(); |
| 22 | |
Brian Silverman | fe1ef17 | 2014-04-12 17:12:45 -0700 | [diff] [blame] | 23 | // Sets up this process to write core dump files. |
Brian Silverman | 6da0427 | 2014-05-18 18:47:48 -0700 | [diff] [blame] | 24 | // This is called by Init*, but it's here for other files that want this |
| 25 | // behavior without calling Init*. |
Brian Silverman | fe1ef17 | 2014-04-12 17:12:45 -0700 | [diff] [blame] | 26 | void WriteCoreDumps(); |
| 27 | |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 28 | } // namespace aos |
| 29 | |
Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 30 | #endif // AOS_LINUX_CODE_INIT_H_ |