Changeset 3936
- Timestamp:
- 03/21/06 19:17:46 (3 years ago)
- Files:
-
- wire/trunk/wire/main.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wire/trunk/wire/main.c
r3838 r3936 161 161 162 162 wi_release(pool); 163 pool = wi_pool_init(wi_pool_alloc()); 163 164 164 165 /* enter event loop */ 165 pool = wi_pool_init(wi_pool_alloc());166 166 wr_runloop_run(); 167 wi_release(pool);168 167 169 168 /* clean up */ 170 pool = wi_pool_init(wi_pool_alloc());171 169 wr_cleanup(); 172 170 wi_release(pool); … … 320 318 321 319 void wr_runloop_run(void) { 322 wi_pool_t *pool = NULL;320 wi_pool_t *pool, *loop_pool = NULL; 323 321 wi_socket_t *socket; 324 322 wi_time_interval_t interval, ping_interval; … … 326 324 int result; 327 325 326 pool = wi_pool_init(wi_pool_alloc()); 327 328 328 socket = wi_socket_init_with_descriptor(wi_socket_alloc(), STDIN_FILENO); 329 329 wi_socket_set_direction(socket, WI_SOCKET_READ); … … 334 334 335 335 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()); 338 338 339 339 result = wr_runloop(wr_runloop_sockets, 30.0); … … 348 348 } 349 349 350 wi_release( pool);351 pool = NULL;350 wi_release(loop_pool); 351 loop_pool = NULL; 352 352 } 353 353 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; 357 357 } 358 358 } 359 360 wi_release(pool); 359 361 } 360 362
