Changes in lib/trace.c [bdc8b36:04bf7c5]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
rbdc8b36 r04bf7c5 108 108 static struct libtrace_format_t *formats_list = NULL; 109 109 110 int libtrace_halt = 0;110 volatile int libtrace_halt = 0; 111 111 112 112 /* Set once pstart is called used for backwards compatibility reasons */ … … 261 261 262 262 /* Parallel inits */ 263 // libtrace->libtrace_lock264 // libtrace->perpkt_cond;263 ASSERT_RET(pthread_mutex_init(&libtrace->libtrace_lock, NULL), == 0); 264 ASSERT_RET(pthread_cond_init(&libtrace->perpkt_cond, NULL), == 0); 265 265 libtrace->state = STATE_NEW; 266 266 libtrace->perpkt_queue_full = false; … … 273 273 libtrace_zero_thread(&libtrace->reporter_thread); 274 274 libtrace_zero_thread(&libtrace->keepalive_thread); 275 libtrace_zero_slidingwindow(&libtrace->sliding_window);276 275 libtrace->reporter_thread.type = THREAD_EMPTY; 277 276 libtrace->perpkt_thread_count = 0; … … 381 380 382 381 /* Parallel inits */ 383 // libtrace->libtrace_lock384 // libtrace->perpkt_cond;382 ASSERT_RET(pthread_mutex_init(&libtrace->libtrace_lock, NULL), == 0); 383 ASSERT_RET(pthread_cond_init(&libtrace->perpkt_cond, NULL), == 0); 385 384 libtrace->state = STATE_NEW; // TODO MAYBE DEAD 386 385 libtrace->perpkt_queue_full = false; … … 393 392 libtrace_zero_thread(&libtrace->reporter_thread); 394 393 libtrace_zero_thread(&libtrace->keepalive_thread); 395 libtrace_zero_slidingwindow(&libtrace->sliding_window);396 394 libtrace->reporter_thread.type = THREAD_EMPTY; 397 395 libtrace->perpkt_thread_count = 0; … … 634 632 */ 635 633 DLLEXPORT void trace_destroy(libtrace_t *libtrace) { 636 634 int i; 637 635 assert(libtrace); 638 636 639 /* destroy any packet that are still around */ 637 ASSERT_RET(pthread_mutex_destroy(&libtrace->libtrace_lock), == 0); 638 ASSERT_RET(pthread_cond_destroy(&libtrace->perpkt_cond), == 0); 639 640 /* destroy any packets that are still around */ 640 641 if (libtrace->state != STATE_NEW && libtrace->first_packets.packets) { 641 642 for (i = 0; i < libtrace->perpkt_thread_count; ++i) { … … 687 688 DLLEXPORT void trace_destroy_dead(libtrace_t *libtrace) { 688 689 assert(libtrace); 690 691 ASSERT_RET(pthread_mutex_destroy(&libtrace->libtrace_lock), == 0); 692 ASSERT_RET(pthread_cond_destroy(&libtrace->perpkt_cond), == 0); 689 693 690 694 /* Don't call pause_input or fin_input, because we should never have
Note: See TracChangeset
for help on using the changeset viewer.