Changeset 3843

Show
Ignore:
Timestamp:
03/01/06 19:39:17 (3 years ago)
Author:
morris
Message:

Remove debug

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/libwired/thread/wi-timer.c

    r3834 r3843  
    124124        uint32_t                        i = 0; 
    125125         
    126         pthread_cleanup_push(wi_crash, NULL); 
    127          
    128126        pool = wi_pool_init(wi_pool_alloc()); 
    129127         
    130         wi_log_debug(WI_STR(">>> enter _wi_timer_thread()")); 
    131  
    132128        while(true) { 
    133129                if(!pool) 
     
    140136 
    141137                if(!timer) { 
    142                         wi_log_debug(WI_STR(">>> got no timers, waiting forever")); 
    143138                        wi_condition_lock_lock_when_condition(_wi_timer_lock, 1, 0.0); 
    144                         wi_log_debug(WI_STR(">>> locked in thread")); 
    145139 
    146140                        timer = wi_list_first_data(_wi_timers); 
    147141                        interval = wi_time_interval(); 
    148  
    149                         if(timer) 
    150                                 wi_log_debug(WI_STR(">>> got timer, fire in %.2f"), timer->fire - interval); 
    151142 
    152143                        if(timer && timer->fire - interval <= _WI_TIMER_EPSILON) 
     
    156147 
    157148                        if(diff <= _WI_TIMER_EPSILON) { 
    158                                 wi_log_debug(WI_STR(">>> got timer, can fire immediately")); 
    159  
    160149                                fire_timer = timer; 
    161150 
    162151                                locked = false; 
    163152                        } else { 
    164                                 wi_log_debug(WI_STR(">>> got timer, waiting for %.2f"), diff); 
    165                                 if(!wi_condition_lock_lock_when_condition(_wi_timer_lock, 1, timer->fire)) { 
     153                                if(!wi_condition_lock_lock_when_condition(_wi_timer_lock, 1, timer->fire)) 
    166154                                        fire_timer = wi_list_first_data(_wi_timers); 
    167                                         wi_log_debug(WI_STR(">>> finished waiting, got %@"), fire_timer); 
    168                                 } 
    169                                 else 
    170                                         wi_log_debug(WI_STR(">>> interrupted while waiting, rechecking")); 
    171                                 wi_log_debug(WI_STR(">>> locked in thread")); 
    172155                        }  
    173156                } 
    174  
    175                 wi_log_debug(WI_STR(">>> firing %@"), fire_timer); 
    176157 
    177158                if(fire_timer) { 
     
    184165                } 
    185166 
    186                 if(locked) { 
     167                if(locked) 
    187168                        wi_condition_lock_unlock_with_condition(_wi_timer_lock, 0); 
    188                         wi_log_debug(WI_STR(">>> unlocked in thread")); 
    189                 } 
    190169                 
    191170                if(++i % 100 == 0) { 
     
    195174        } 
    196175 
    197         wi_log_debug(WI_STR(">>> exit _wi_timer_thread()")); 
    198          
    199176        wi_release(pool); 
    200          
    201         pthread_cleanup_pop(1); 
    202177} 
    203178 
     
    285260                pthread_once(&_wi_timer_once_control, _wi_timer_create_thread); 
    286261 
    287                 if(!timer->incallback) { 
    288                         wi_log_debug(WI_STR("--- locking in schedule")); 
     262                if(!timer->incallback) 
    289263                        wi_condition_lock_lock(_wi_timer_lock); 
    290                 } 
    291264                 
    292265                _wi_timer_schedule(timer); 
    293266                 
    294                 if(!timer->incallback) { 
    295                         wi_log_debug(WI_STR("--- unlocking in schedule")); 
     267                if(!timer->incallback) 
    296268                        wi_condition_lock_unlock_with_condition(_wi_timer_lock, 1); 
    297                 } 
    298269        } 
    299270} 
     
    307278                _wi_timer_invalidate(timer); 
    308279 
    309         if(!timer->incallback) { 
    310                 wi_log_debug(WI_STR("+++ locking in reschedule")); 
     280        if(!timer->incallback) 
    311281                wi_condition_lock_lock(_wi_timer_lock); 
    312         } 
    313282 
    314283        _wi_timer_schedule(timer); 
    315284 
    316         if(!timer->incallback) { 
    317                 wi_log_debug(WI_STR("+++ unlocking in reschedule")); 
     285        if(!timer->incallback) 
    318286                wi_condition_lock_unlock_with_condition(_wi_timer_lock, 1); 
    319         } 
    320287} 
    321288 
     
    332299void wi_timer_invalidate(wi_timer_t *timer) { 
    333300        if(timer->scheduled) { 
    334                 if(!timer->incallback) { 
    335                         wi_log_debug(WI_STR("*** locking in invalidate")); 
     301                if(!timer->incallback) 
    336302                        wi_condition_lock_lock(_wi_timer_lock); 
    337                 } 
    338303                 
    339304                _wi_timer_invalidate(timer); 
    340305                 
    341                 if(!timer->incallback) { 
    342                         wi_log_debug(WI_STR("*** unlocking in invalidate")); 
     306                if(!timer->incallback) 
    343307                        wi_condition_lock_unlock_with_condition(_wi_timer_lock, 1); 
    344                 } 
    345308        } 
    346309}