Changeset 23522
- Timestamp:
- 02/25/08 11:42:03 (9 months ago)
- Files:
-
- 1 modified
-
trunk/launchd/src/libvproc_public.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/libvproc_public.h
r23521 r23522 40 40 * Processes have two reference counts associated with them: 41 41 * 42 * Dirty Tracks dirty data that needs to be flushed later. 43 * Standby Tracks any case where future work is expected. 42 * Transactions Tracks unfinished work. For example: saving a modified 43 * document. 44 * Standby Tracks outstanding callbacks from external subsystems. 44 45 * 45 * Processes that have no dirty data are called "clean." 46 * Processes that are not standing by are called "idle." 46 * Descriptive aliases: 47 47 * 48 * These two reference counts are used to prevent the application from 49 * prematurely exiting. 48 * A process with no outstanding transactions is called "clean." 49 * A process with outstanding transactions is called "dirty." 50 * A process with no standby work is called "idle." 50 51 * 51 52 * Sometimes, the operating system needs processes to exit. Unix has two … … 56 57 * 57 58 * If a process is clean, the operating system is free to SIGKILL it at 58 * shutdown or logout. 59 * shutdown or logout. This behavior is opt in. 59 60 * 60 61 * If a process is clean and idle, the operating system may send SIGKILL after 61 * a application specified timeout. 62 * a application specified timeout. This behavior is opt in. 62 63 * 63 64 * If a process is dirty and idle, the operating system may send SIGTERM after 64 * a application specified timeout. 65 * a application specified timeout. This behavior is opt in. 65 66 * 66 67 * 67 68 * launchd jobs should update their property lists accordingly. 68 69 * 69 * LaunchServices euses private API to coordinate whether GUI applications70 * LaunchServices uses private API to coordinate whether GUI applications 70 71 * have opted into this design. 71 72 */ 72 73 73 74 /*! 74 * @function vproc_dirty_retain 75 * @function vproc_transaction_prepare 76 * 77 * @result 78 * Returns an opaque handle to be passed to vproc_transaction_complete(). 75 79 * 76 80 * @abstract 77 81 * Call this API before creating data that needs to be saved via I/O later. 78 82 */ 79 void 80 vproc_ dirty_retain(void);83 void * 84 vproc_transaction_prepare(void); 81 85 82 86 /*! 83 * @function vproc_dirty_release 87 * @function vproc_transaction_complete 88 * 89 * @param 90 * The handle previously created with vproc_transaction_prepare(). 84 91 * 85 92 * @abstract 86 * Call this API after the dirty data has either been flushed or otherwise resolved. 93 * Call this API after the data has either been flushed or otherwise resolved. 94 * 95 * @discussion 96 * Calling this API with the same handle more than once is undefined. 87 97 */ 88 98 void 89 vproc_ dirty_release(void);99 vproc_transaction_complete(void *handle); 90 100 91 101 /*! 92 * @function vproc_dirty_count 93 * 94 * @result 95 * Zero if the program is clean. Non-zero if the program contains dirty data. 102 * @function vproc_standby_prepare 96 103 * 97 104 * @abstract 98 * A simple API to discover whether the program is dirty or not. 105 * Call this API before registering notifications. For example: timers network 106 * state change, or when monitoring keyboard/mouse events. 99 107 */ 100 size_t 101 vproc_ dirty_count(void);108 void * 109 vproc_standby_prepare(void); 102 110 103 111 /*! 104 * @function vproc_standby_retain 105 * 106 * @abstract 107 * Call this API when registering notifications. For example: timers network 108 * state change, or when monitoring keyboard/mouse events. 109 */ 110 void vproc_standby_retain(void); 111 112 /*! 113 * @function vproc_standby_release 112 * @function vproc_standby_complete 114 113 * 115 114 * @abstract 116 115 * Call this API when deregistering notifications. 116 * 117 * @discussion 118 * Calling this API with the same handle more than once is undefined. 117 119 */ 118 void vproc_standby_release(void); 119 120 /*! 121 * @function vproc_standby_count 122 * 123 * @result 124 * Zero if the program is idle. Non-zero if the program contains outstanding event sources registered. 125 * 126 * @abstract 127 * A simple API to discover whether the program is idle or not. 128 */ 129 size_t 130 size_t vproc_standby_count(void); 120 void 121 vproc_standby_complete(void *handle); 131 122 132 123 #pragma GCC visibility pop

