--- libgig/trunk/src/RIFF.h 2021/06/07 18:57:17 3915 +++ libgig/trunk/src/RIFF.h 2021/06/07 19:42:17 3916 @@ -406,6 +406,7 @@ stream_mode_t Mode; ///< State of handles (ro, rw, closed). }; struct IO : HandlePair { + bool isPerThread; ///< Whether SetIOPerThread(true) was called. mutable std::map byThread; ///< Optional: Individual file handle pair for each thread separately. mutable std::mutex mutex; ///< For protecting concurrent changes on the @c byThread map itself and replacing handles. } io; @@ -434,6 +435,7 @@ int FileOffsetSizeFor(file_offset_t fileSize) const; void Cleanup(); HandlePair& FileHandlePairUnsafeRef(); + bool SetModeInternal(stream_mode_t NewMode, bool* pResetPos); }; /**