PIBinaryLog fix
This commit is contained in:
@@ -357,7 +357,9 @@ PIByteArray PIBinaryLog::readBinLog(int id, PISystemTime * time, int * readed_id
|
||||
if (readed_id) *readed_id = br.id;
|
||||
return br.data;
|
||||
}
|
||||
logmutex.lock();
|
||||
while (br.id != id && !isEnd()) br = readRecord();
|
||||
logmutex.unlock();
|
||||
if (br.id == -1) {
|
||||
piCoutObj << "End of BinLog file";
|
||||
fileEnd();
|
||||
@@ -668,6 +670,7 @@ bool PIBinaryLog::createIndex() {
|
||||
void PIBinaryLog::seekTo(int rindex) {
|
||||
// piCoutObj << "seekTo";
|
||||
logmutex.lock();
|
||||
pausemutex.lock();
|
||||
if (rindex < index.size_s() && rindex >= 0) {
|
||||
file.seek(index[rindex].pos);
|
||||
moveIndex(index_pos.value(file.pos(), -1));
|
||||
@@ -679,6 +682,7 @@ void PIBinaryLog::seekTo(int rindex) {
|
||||
}
|
||||
}
|
||||
// piCoutObj << "seekTo done";
|
||||
pausemutex.unlock();
|
||||
logmutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -201,6 +201,9 @@ public:
|
||||
//! Returns timestamp of last readed record
|
||||
PISystemTime lastReadedTimestamp() const {return lastrecord.timestamp;}
|
||||
|
||||
//! Returns timestamp of log start
|
||||
PISystemTime logStartTimestamp() const {return startlogtime;}
|
||||
|
||||
//!Set custom file header, you can get it back when read this binlog
|
||||
void setHeader(const PIByteArray & header);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user