Skip to content

Commit

Permalink
Merge pull request #1074 from Christian8491/fix/grow_buffer_unlock
Browse files Browse the repository at this point in the history
[REVIEW] Remove lock inside grow() method from PinnedBufferProvider
  • Loading branch information
William Malpica authored Oct 9, 2020
2 parents 36ebc3f + dfc84c5 commit c3b1ef7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


# BlazingSQL 0.15.0 (August 31, 2020)
Expand Down
1 change: 1 addition & 0 deletions comms/include/blazingdb/transport/io/reader_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions comms/src/blazingdb/transport/io/reader_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::mutex> lock(inUseMutex);

PinnedBuffer *buffer = new PinnedBuffer();
buffer->size = this->bufferSize;
allocations.resize(allocations.size() + 1);
Expand Down

0 comments on commit c3b1ef7

Please sign in to comment.