Skip to content
Snippets Groups Projects
Commit 56dcb469 authored by Cristina Moraru's avatar Cristina Moraru
Browse files

Fix deadlock


For m_maxFilesRequest equals 2 or 3 and
0 remaining  tasks, first branch is taken
instead of the second one, causing a deadlock.

Signed-off-by: default avatarCristina Moraru <cristina-gabriela.moraru@cern.ch>
parent 09f3e6dd
Branches
Tags
No related merge requests found
......@@ -157,14 +157,14 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::popAndRequestMoreJobs(){
// If we just passed (down) the half full limit, ask for more
// (the remaining value is after pop)
isLastTask = false;
if(vrp.remaining + 1 == m_maxFilesRequest/2) {
// This is not a last call
m_taskInjector->requestInjection(false);
} else if (0 == vrp.remaining) {
if(0 == vrp.remaining) {
// This is a last call: if the task injector comes up empty on this
// one, he'll call it the end.
m_taskInjector->requestInjection(true);
isLastTask = true;
} else if (vrp.remaining + 1 == m_maxFilesRequest/2) {
// This is not a last call
m_taskInjector->requestInjection(false);
}
return vrp.value;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment