diff --git a/CHANGELOG.md b/CHANGELOG.md index 139906967..5971ea95b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - #1057 Fixed issue with concat all in concatenating cache - #1007 Fix arrow and spdlog compilation issues - #1068 Just adds a docs important links and avoid the message about filesystem authority not found +- #1074: Remove lock inside grow() method from PinnedBufferProvider - #1071 Fix crash when loading an empty folder diff --git a/comms/include/blazingdb/transport/io/reader_writer.h b/comms/include/blazingdb/transport/io/reader_writer.h index 7c695060f..6c37c69c9 100644 --- a/comms/include/blazingdb/transport/io/reader_writer.h +++ b/comms/include/blazingdb/transport/io/reader_writer.h @@ -32,6 +32,7 @@ class PinnedBufferProvider { void freeAll(); private: + // Its not threadsafe and the lock needs to be applied before calling it void grow(); std::condition_variable cv; diff --git a/comms/src/blazingdb/transport/io/reader_writer.cpp b/comms/src/blazingdb/transport/io/reader_writer.cpp index 0779fa6e8..f201d45e6 100644 --- a/comms/src/blazingdb/transport/io/reader_writer.cpp +++ b/comms/src/blazingdb/transport/io/reader_writer.cpp @@ -68,9 +68,8 @@ PinnedBuffer *PinnedBufferProvider::getBuffer() { // Will create a new allocation and grow the buffer pool with this->numBuffers/2 new buffers +// Its not threadsafe and the lock needs to be applied before calling it void PinnedBufferProvider::grow() { - std::unique_lock lock(inUseMutex); - PinnedBuffer *buffer = new PinnedBuffer(); buffer->size = this->bufferSize; allocations.resize(allocations.size() + 1);