Projects
Browse Source     Search     Timeline     Wiki

Changeset 23522

Show
Ignore:
Timestamp:
2008-02-25 11:42:03 (6 months ago)
Author:
zarzycki@…
Message:

Incorporated feedback.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/launchd/src/libvproc_public.h

    r23521 r23522  
    4040 * Processes have two reference counts associated with them: 
    4141 * 
    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. 
    4445 * 
    45  * Processes that have no dirty data are called "clean." 
    46  * Processes that are not standing by are called "idle." 
     46 * Descriptive aliases: 
    4747 * 
    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." 
    5051 * 
    5152 * Sometimes, the operating system needs processes to exit. Unix has two 
     
    5657 * 
    5758 * 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. 
    5960 * 
    6061 * 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. 
    6263 * 
    6364 * 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. 
    6566 * 
    6667 * 
    6768 * launchd jobs should update their property lists accordingly. 
    6869 * 
    69  * LaunchServicese uses private API to coordinate whether GUI applications 
     70 * LaunchServices uses private API to coordinate whether GUI applications 
    7071 * have opted into this design. 
    7172 */ 
    7273 
    7374/*! 
    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(). 
    7579 * 
    7680 * @abstract 
    7781 * Call this API before creating data that needs to be saved via I/O later. 
    7882 */ 
    79 void 
    80 vproc_dirty_retain(void); 
     83void * 
     84vproc_transaction_prepare(void); 
    8185 
    8286/*! 
    83  * @function vproc_dirty_release 
     87 * @function vproc_transaction_complete 
     88 * 
     89 * @param 
     90 * The handle previously created with vproc_transaction_prepare(). 
    8491 * 
    8592 * @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. 
    8797 */ 
    8898void 
    89 vproc_dirty_release(void); 
     99vproc_transaction_complete(void *handle); 
    90100 
    91101/*! 
    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 
    96103 * 
    97104 * @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. 
    99107 */ 
    100 size_t 
    101 vproc_dirty_count(void); 
     108void * 
     109vproc_standby_prepare(void); 
    102110 
    103111/*! 
    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 
    114113 * 
    115114 * @abstract 
    116115 * Call this API when deregistering notifications. 
     116 * 
     117 * @discussion 
     118 * Calling this API with the same handle more than once is undefined. 
    117119 */ 
    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); 
     120void 
     121vproc_standby_complete(void *handle); 
    131122 
    132123#pragma GCC visibility pop