Changeset 3935

Show
Ignore:
Timestamp:
03/21/06 19:17:40 (2 years ago)
Author:
morris
Message:

Use separate loop pool

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trackerd/trunk/trackerd/commands.c

    r3832 r3935  
    8080 
    8181void wt_control_thread(wi_runtime_instance_t *argument) { 
    82         wi_pool_t               *pool
     82        wi_pool_t               *pool, *loop_pool = NULL
    8383        wt_client_t             *client = (wt_client_t *) argument; 
    8484        wi_string_t             *string; 
     
    9191 
    9292        while(client->state <= WT_CLIENT_STATE_SAID_HELLO) { 
    93                 if(!pool) 
    94                         pool = wi_pool_init(wi_pool_alloc()); 
     93                if(!loop_pool) 
     94                        loop_pool = wi_pool_init(wi_pool_alloc()); 
    9595                 
    9696                if(client->buffer_offset == 0) { 
     
    129129                 
    130130                if(++i % 10 == 0) { 
    131                         wi_release(pool); 
    132                         pool = NULL; 
     131                        wi_release(loop_pool); 
     132                        loop_pool = NULL; 
    133133                } 
    134134        } 
  • trackerd/trunk/trackerd/main.c

    r3836 r3935  
    431431static void wt_signal_crash(int sigraised) { 
    432432        wt_cleanup(); 
     433         
     434        sleep(360); 
    433435 
    434436        if(signal(sigraised, SIG_DFL) != SIG_ERR) 
  • trackerd/trunk/trackerd/tracker.c

    r3906 r3935  
    206206 
    207207static void wt_listen_thread(wi_runtime_instance_t *arg) { 
    208         wi_pool_t                       *pool
     208        wi_pool_t                       *pool, *loop_pool = NULL
    209209        wi_socket_t                     *socket; 
    210210        wi_address_t            *address; 
     
    216216 
    217217        while(wt_running) { 
    218                 if(!pool) 
    219                         pool = wi_pool_init(wi_pool_alloc()); 
     218                if(!loop_pool) 
     219                        loop_pool = wi_pool_init(wi_pool_alloc()); 
    220220 
    221221                ip = NULL; 
     
    250250next: 
    251251                if(++i % 100 == 0) { 
    252                         wi_release(pool); 
    253                         pool = NULL; 
     252                        wi_release(loop_pool); 
     253                        loop_pool = NULL; 
    254254                } 
    255255        } 
     
    261261 
    262262static void wt_receive_thread(wi_runtime_instance_t *arg) { 
    263         wi_pool_t                       *pool
     263        wi_pool_t                       *pool, *loop_pool = NULL
    264264        wi_array_t                      *arguments; 
    265265        wi_address_t            *address; 
     
    274274 
    275275        while(wt_running) { 
    276                 if(!pool) 
    277                         pool = wi_pool_init(wi_pool_alloc()); 
     276                if(!loop_pool) 
     277                        loop_pool = wi_pool_init(wi_pool_alloc()); 
    278278 
    279279                command         = NULL; 
     
    351351next: 
    352352                if(++i % 100 == 0) { 
    353                         wi_release(pool); 
    354                         pool = NULL; 
     353                        wi_release(loop_pool); 
     354                        loop_pool = NULL; 
    355355                } 
    356356        }