Changeset 7718e54


Ignore:
Timestamp:
02/27/15 11:13:46 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
0ec8a7c
Parents:
6c09048
Message:

Remove locking from unregister thread, now it is in line with registering a thread

Make sure packets are finished by the library before they are handed back to a
format.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r526d9d0 r7718e54  
    12281228        assert(packet);
    12291229
    1230         /* Clear the packet cache */
    1231         trace_clear_cache(packet);
     1230        /* Free the last packet */
     1231        trace_fin_packet(packet);
    12321232       
    12331233        /* Store the trace we are reading from into the packet opaque
  • lib/trace_parallel.c

    r2adc1d0 r7718e54  
    679679        // causing destroy/finish packet to fail.
    680680        libtrace_ocache_unregister_thread(&trace->packet_freelist);
    681         ASSERT_RET(pthread_mutex_lock(&trace->libtrace_lock), == 0);
    682681        if (trace->format->punregister_thread) {
    683682                trace->format->punregister_thread(trace, t);
    684683        }
    685684        print_memory_stats();
    686 
    687         ASSERT_RET(pthread_mutex_unlock(&trace->libtrace_lock), == 0);
    688685
    689686        pthread_exit(NULL);
     
    818815        trace_send_message_to_reporter(trace, &message);
    819816        libtrace_ocache_unregister_thread(&trace->packet_freelist);
    820         ASSERT_RET(pthread_mutex_lock(&trace->libtrace_lock), == 0);
    821817        if (trace->format->punregister_thread) {
    822818                trace->format->punregister_thread(trace, t);
    823819        }
    824820        print_memory_stats();
    825         ASSERT_RET(pthread_mutex_unlock(&trace->libtrace_lock), == 0);
    826821
    827822        // TODO remove from TTABLE t sometime
Note: See TracChangeset for help on using the changeset viewer.