Changeset 8925
- Timestamp:
- 07/08/11 15:47:24 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/Orange-Branch/src/common/mgmt/pint-worker-threaded-queues.c
r8869 r8925 75 75 gen_cond_destroy(&w->cond); 76 76 } 77 gossip_debug(GOSSIP_MGMT_DEBUG,"%s:thread_id %d:thread #%d.\n" 78 ,__func__ 79 ,(int)w->threads[i].thread_id,i); 77 80 } 78 81 … … 338 341 gen_mutex_unlock(&thread->mutex); 339 342 343 gossip_debug(GOSSIP_MGMT_DEBUG,"%s:thread-id %d:worker location is %p: manager location is %p.\n" 344 ,__func__ 345 ,(int)thread->thread_id 346 ,worker 347 ,manager); 348 340 349 gen_mutex_lock(&worker->mutex); 341 350 op_count = worker->attr.ops_per_queue; … … 347 356 gen_mutex_unlock(&worker->mutex); 348 357 358 gossip_debug(GOSSIP_MGMT_DEBUG,"%s:thread-id %d:op-count is %d:timeout is %d.\n" 359 ,__func__ 360 ,(int)thread->thread_id 361 ,op_count 362 ,timeout); 349 363 qentries = malloc(sizeof(PINT_queue_entry_t *) * op_count); 350 364 if(!qentries) … … 357 371 gen_mutex_lock(&thread->mutex); 358 372 thread->running = 1; 373 gossip_debug(GOSSIP_MGMT_DEBUG,"%s: starting thread function for thread_id %d\n" 374 ,__func__ 375 ,(int)thread->thread_id); 359 376 while(thread->running) 360 377 { … … 421 438 if(op_count > 0) 422 439 { 440 gossip_debug(GOSSIP_MGMT_DEBUG,"%s:thread_id %d: op_count is %d.\n" 441 ,__func__ 442 ,(int)thread->thread_id,op_count); 423 443 for(i = 0; i < op_count; ++i) 424 444 { 445 struct PINT_op_entry *op_entry; 446 gossip_debug(GOSSIP_MGMT_DEBUG,"%s:thread_id %d: i is %d.\n" 447 ,__func__ 448 ,(int)thread->thread_id,i); 425 449 op = PINT_op_from_qentry(qentries[i]); 426 450 /* service the operation */ 451 gossip_debug(GOSSIP_MGMT_DEBUG,"%s:thread_id %d: calling PINT_manager_service_op.\n" 452 ,__func__ 453 ,(int)thread->thread_id); 427 454 ret = PINT_manager_service_op( 428 455 manager, op, &service_time, &error); … … 433 460 } 434 461 462 gossip_debug(GOSSIP_MGMT_DEBUG,"%s:thread_id %d: calling PINT_manager_complete_op.\n" 463 ,__func__ 464 ,(int)thread->thread_id); 435 465 ret = PINT_manager_complete_op( 436 466 manager, op, error); … … 439 469 /* fatal if we can't complete an op */ 440 470 goto free_ops; 471 } 472 op_entry = id_gen_safe_lookup(op->id); 473 if (op_entry) 474 { 475 id_gen_safe_unregister(op_entry->op.id); 476 free(op_entry); 477 op_entry = NULL; 441 478 } 442 479 } … … 466 503 /* lock the mutex again before checking the running field */ 467 504 gen_mutex_lock(&thread->mutex); 468 } 505 }/*end while thread->running*/ 469 506 470 507 gen_mutex_unlock(&thread->mutex);
