Permalink
Browse files

o a bit less lock contention. It looks like this could've been

  the reason for a deadlock, though not sure.
  • Loading branch information...
1 parent 1d1c2e1 commit e3e1a0bc8ce908689519c36ebc97e7ad8320f2ab @hzeller committed Oct 14, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 buffer-thread.cc
View
@@ -93,10 +93,11 @@ void BufferThread::Run() {
work.buffer->FillUntil(work.buffer->FileSize() + kBufferChunk);
}
+ const bool work_complete = IsWorkComplete(work);
{
folve::MutexLock l(&mutex_);
- assert(queue_.front().buffer = current_work_buffer_);
- if (!IsWorkComplete(queue_.front())) { // More work to do ? Re-schedule.
+ assert(queue_.front().buffer == current_work_buffer_);
+ if (!work_complete) { // More work to do ? Re-schedule.
queue_.push_back(queue_.front());
}
queue_.pop_front();

0 comments on commit e3e1a0b

Please sign in to comment.