Fix data race.

+ Add thread-safety with mutexes in `PieceTable` and `Buffer`
+ Bump version to 1.5.9
This commit is contained in:
2026-01-28 01:03:58 -08:00
parent 8634eb78f0
commit d2d155f211
5 changed files with 116 additions and 83 deletions

View File

@@ -8,6 +8,7 @@
#include <ostream>
#include <vector>
#include <limits>
#include <mutex>
class PieceTable {
@@ -181,4 +182,6 @@ private:
mutable RangeCache range_cache_;
mutable FindCache find_cache_;
mutable std::mutex mutex_;
};