Changeset dea08f1


Ignore:
Timestamp:
02/28/17 13:47:49 (4 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
db84bb2
Parents:
cac1d92
Message:

Fix wandio race conditions

libwandio is not thread-safe, so file-based formats need to
be careful about when try to operate on the file.

This should fix most of the issues with crashes, segfaults, etc.
when reading from files (including most of our parallel file test
cases!)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace_parallel.c

    rceba2b2 rdea08f1  
    677677                        if (!trace->pread) {
    678678                                assert(packets[0]);
     679                                ASSERT_RET(pthread_mutex_lock(&trace->libtrace_lock), == 0);
    679680                                nb_packets = trace_read_packet(trace, packets[0]);
     681                                ASSERT_RET(pthread_mutex_unlock(&trace->libtrace_lock), == 0);
    680682                                packets[0]->error = nb_packets;
    681683                                if (nb_packets > 0)
Note: See TracChangeset for help on using the changeset viewer.