Ticket #6323: patch

File patch, 1.3 KB (added by Matthias "mortalmatt" Dahl, 11 years ago)
  • ThreadedFileWriter.cpp

     
    277277        bufferHasData.wakeAll();
    278278
    279279        remaining -= bytes;
     280        if(remaining)
     281        {
     282            data = (const char*)data + bytes;
    280283
    281         buflock.lock();
    282         if (remaining && (0 == BufFreePriv()))
    283             bufferWroteData.wait(&buflock, 10000);
    284         buflock.unlock();
     284            buflock.lock();
     285            if (0 == BufFreePriv())
     286                bufferWroteData.wait(&buflock, 10000);
     287            buflock.unlock();
     288        }
    285289    }
    286290
    287291    return count;
  • ThreadedFileWriter.h

     
    5353    long long       tfw_min_write_size;
    5454
    5555    // buffer position state
    56     uint            rpos;    ///< points to end of data written to disk
    57     uint            wpos;    ///< points to end of data added to buffer
     56    volatile uint   rpos;    ///< points to end of data written to disk
     57    volatile uint   wpos;    ///< points to end of data added to buffer
    5858    mutable QMutex  buflock; ///< lock needed to update rpos and wpos
    5959    long long       written;
    6060