Merge branch 'staged' into dev

This commit is contained in:
Xiao YiFang 2022-06-17 20:23:29 +08:00
commit e482e499a3
2 changed files with 3 additions and 1 deletions

View file

@ -137,7 +137,7 @@ char * Reader::getBlock( uint32_t address, vector< char > & chunk )
// Read and decompress the chunk // Read and decompress the chunk
{ {
// file.seek( offsets[ chunkIdx ] ); // file.seek( offsets[ chunkIdx ] );
Mutex::Lock _( file.lock );
auto bytes = file.map( offsets[ chunkIdx ], 8 ); auto bytes = file.map( offsets[ chunkIdx ], 8 );
auto qBytes = QByteArray::fromRawData( reinterpret_cast< char * >(bytes), 8 ); auto qBytes = QByteArray::fromRawData( reinterpret_cast< char * >(bytes), 8 );
QDataStream in( qBytes ); QDataStream in( qBytes );

View file

@ -9,6 +9,7 @@
#include <vector> #include <vector>
#include <QFile> #include <QFile>
#include "ex.hh" #include "ex.hh"
#include "mutex.hh"
/// A simple wrapper over FILE * operations with added write-buffering, /// A simple wrapper over FILE * operations with added write-buffering,
/// used for non-Qt parts of code. /// used for non-Qt parts of code.
@ -44,6 +45,7 @@ class Class
void open( char const * filename, char const * mode ) ; void open( char const * filename, char const * mode ) ;
public: public:
Mutex lock;
Class( char const * filename, char const * mode ) ; Class( char const * filename, char const * mode ) ;