Ignore:
Timestamp:
Nov 9, 2005 3:37:19 PM (19 years ago)
Author:
bennylp
Message:

Rework pjlib++

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/main/pjlib/include/pj/timer.h

    r4 r36  
    111111 
    112112/** 
    113  * Default flag for timer heap, indicates that synchronization will be 
    114  * used. 
    115  */ 
    116 #define PJ_TIMER_HEAP_SYNCHRONIZE       (0) 
    117  
    118 /** 
    119  * Flag to indicate that thread synchronization is NOT needed for the  
    120  * timer heap. 
    121  */ 
    122 #define PJ_TIMER_HEAP_NO_SYNCHRONIZE    (1) 
    123  
    124 /** 
    125113 * Calculate memory size required to create a timer heap. 
    126114 * 
     
    141129 *                  initially. If the application registers more entries  
    142130 *                  during runtime, then the timer heap will resize. 
    143  * @param flag      Creation flag, currently only PJ_TIMER_HEAP_NO_SYNCHRONIZE 
    144  *                  is recognized.. 
    145131 * @param ht        Pointer to receive the created timer heap. 
    146132 * 
     
    149135PJ_DECL(pj_status_t) pj_timer_heap_create( pj_pool_t *pool, 
    150136                                           pj_size_t count, 
    151                                            unsigned flag, 
    152137                                           pj_timer_heap_t **ht); 
     138 
     139/** 
     140 * Destroy the timer heap. 
     141 * 
     142 * @param ht        The timer heap. 
     143 */ 
     144PJ_DECL(void) pj_timer_heap_destroy( pj_timer_heap_t *ht ); 
     145 
     146 
     147/** 
     148 * Set lock object to be used by the timer heap. By default, the timer heap 
     149 * uses dummy synchronization. 
     150 * 
     151 * @param ht        The timer heap. 
     152 * @param lock      The lock object to be used for synchronization. 
     153 * @param auto_del  If nonzero, the lock object will be destroyed when 
     154 *                  the timer heap is destroyed. 
     155 */ 
     156PJ_DECL(void) pj_timer_heap_set_lock( pj_timer_heap_t *ht, 
     157                                      pj_lock_t *lock, 
     158                                      pj_bool_t auto_del ); 
     159 
     160/** 
     161 * Set maximum number of timed out entries to process in a single poll. 
     162 * 
     163 * @param ht        The timer heap. 
     164 * @param count     Number of entries. 
     165 * 
     166 * @return          The old number. 
     167 */ 
     168PJ_DECL(unsigned) pj_timer_heap_set_max_timed_out_per_poll(pj_timer_heap_t *ht, 
     169                                                           unsigned count ); 
    153170 
    154171/** 
     
    216233 */ 
    217234PJ_DECL(pj_status_t) pj_timer_heap_earliest_time( pj_timer_heap_t *ht,  
    218                                            pj_time_val *timeval); 
     235                                                  pj_time_val *timeval); 
    219236 
    220237/** 
     
    222239 * each of the expired timers. 
    223240 * 
    224  * @param ht        The timer heap. 
     241 * @param ht         The timer heap. 
    225242 * @param next_delay If this parameter is not NULL, it will be filled up with 
    226243 *                   the time delay until the next timer elapsed, or -1 in 
    227244 *                   the sec part if no entry exist. 
    228  * @return          The number of timers expired. 
    229  */ 
    230 PJ_DECL(int) pj_timer_heap_poll( pj_timer_heap_t *ht, pj_time_val *next_delay); 
     245 * 
     246 * @return           The number of timers expired. 
     247 */ 
     248PJ_DECL(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht,  
     249                                      pj_time_val *next_delay); 
    231250 
    232251/** 
Note: See TracChangeset for help on using the changeset viewer.