Commit 2395b641 authored by Cristina Moraru's avatar Cristina Moraru
Browse files

Fix promise usage



Signed-off-by: default avatarCristina Moraru <cristina-gabriela.moraru@cern.ch>
parent ada19b99
......@@ -62,11 +62,6 @@ RecallTaskInjector::~RecallTaskInjector(){
void RecallTaskInjector::finish(){
cta::threading::MutexLocker ml(m_producerProtection);
m_queue.push(Request());
/* Since this is the ending request, the RecallTaskInjector does not need
* to wait to have access to the drive
*/
if (m_useRAO)
setPromise();
}
//------------------------------------------------------------------------------
//requestInjection
......
......@@ -156,12 +156,10 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::popAndRequestMoreJobs(){
vrp = m_tasks.popGetSize();
// If we just passed (down) the half full limit, ask for more
// (the remaining value is after pop)
isLastTask = false;
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);
......@@ -322,11 +320,6 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
// This can lead the the session being marked as corrupt, so we test
// it in the while loop
task->execute(*rs, m_logContext, m_watchdog,m_stats,timer);
if (m_useRAO && isLastTask) {
// After the execution of all recalls, the TapeReadSingleThread
// passes the access to the drive to the RecallTaskInjector
m_taskInjector->setPromise();
}
// Transmit the statistics to the watchdog thread
m_watchdog.updateStatsWithoutDeliveryTime(m_stats);
// The session could have been corrupted (failed positioning)
......
......@@ -152,7 +152,6 @@ private:
* Access Order
*/
bool m_useRAO;
bool isLastTask;
/// Helper virtual function to access the watchdog from parent class
virtual void countTapeLogError(const std::string & error) {
m_watchdog.addToErrorCount(error);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment