Changeset 3936

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

Sync

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wire/trunk/wire/main.c

    r3838 r3936  
    161161         
    162162        wi_release(pool); 
     163        pool = wi_pool_init(wi_pool_alloc()); 
    163164         
    164165        /* enter event loop */ 
    165         pool = wi_pool_init(wi_pool_alloc()); 
    166166        wr_runloop_run(); 
    167         wi_release(pool); 
    168167 
    169168        /* clean up */ 
    170         pool = wi_pool_init(wi_pool_alloc()); 
    171169        wr_cleanup(); 
    172170        wi_release(pool); 
     
    320318 
    321319void wr_runloop_run(void) { 
    322         wi_pool_t                       *pool = NULL; 
     320        wi_pool_t                       *pool, *loop_pool = NULL; 
    323321        wi_socket_t                     *socket; 
    324322        wi_time_interval_t      interval, ping_interval; 
     
    326324        int                                     result; 
    327325         
     326        pool = wi_pool_init(wi_pool_alloc()); 
     327 
    328328        socket = wi_socket_init_with_descriptor(wi_socket_alloc(), STDIN_FILENO); 
    329329        wi_socket_set_direction(socket, WI_SOCKET_READ); 
     
    334334         
    335335        while(wr_running) { 
    336                 if(!pool) 
    337                         pool = wi_pool_init(wi_pool_alloc()); 
     336                if(!loop_pool) 
     337                        loop_pool = wi_pool_init(wi_pool_alloc()); 
    338338         
    339339                result = wr_runloop(wr_runloop_sockets, 30.0); 
     
    348348                        } 
    349349                         
    350                         wi_release(pool); 
    351                         pool = NULL; 
     350                        wi_release(loop_pool); 
     351                        loop_pool = NULL; 
    352352                } 
    353353                 
    354                 if(pool && ++i % 100 == 0) { 
    355                         wi_release(pool); 
    356                         pool = NULL; 
     354                if(++i % 100 == 0) { 
     355                        wi_release(loop_pool); 
     356                        loop_pool = NULL; 
    357357                } 
    358358        } 
     359         
     360        wi_release(pool); 
    359361} 
    360362