Skip to content

Commit

Permalink
[Server] Do not hold cheksum lock across local checksum computation.
Browse files Browse the repository at this point in the history
  • Loading branch information
abh3 committed Dec 6, 2021
1 parent 3701651 commit a6a06e6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/XrdXrootd/XrdXrootdJob.cc
Expand Up @@ -38,6 +38,7 @@
#include "XrdOuc/XrdOucProg.hh"
#include "XrdOuc/XrdOucStream.hh"
#include "XrdSys/XrdSysPlatform.hh"
#include "XrdSys/XrdSysRAtomic.hh"
#include "XrdXrootd/XrdXrootdJob.hh"
#include "XrdXrootd/XrdXrootdResponse.hh"
#include "XrdXrootd/XrdXrootdTrace.hh"
Expand All @@ -57,7 +58,7 @@ void DoIt();

enum JobStatus {Job_Active, Job_Cancel, Job_Done, Job_Waiting};

JobStatus Status; // Job Status
XrdSys::RAtomic<JobStatus> Status; // Job Status

XrdXrootdJob2Do(XrdXrootdJob *job,
int jnum,
Expand Down Expand Up @@ -158,10 +159,6 @@ void XrdXrootdJob2Do::DoIt()
char *lp = 0;
int i, rc = 0;

// Obtain a lock to prevent status changes
//
theJob->myMutex.Lock();

// While we were waiting to run we may have been cancelled. If we were not then
// perform the actual function and get the result and send to any async clients
//
Expand All @@ -170,9 +167,9 @@ void XrdXrootdJob2Do::DoIt()
theArgs[3], theArgs[4])))
{Status = Job_Cancel;
lp = jobStream.GetLine();
theJob->myMutex.Lock();
}
else {theJob->myMutex.UnLock();
lp = jobStream.GetLine();
else {lp = jobStream.GetLine();
rc = theJob->theProg->RunDone(jobStream);
theJob->myMutex.Lock();
if ((rc && rc != -EPIPE) || (rc == -EPIPE && (!lp || !(*lp))))
Expand Down

0 comments on commit a6a06e6

Please sign in to comment.