Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/base/src/TROOT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ TObject *TROOT::FindObjectAnyFile(const char *name) const
{
// Scan the memory lists of all files for an object with name

R__LOCKGUARD(gROOTMutex);
TDirectory *d;
TIter next(GetListOfFiles());
while ((d = (TDirectory*)next())) {
Expand Down Expand Up @@ -1097,6 +1098,7 @@ TFile *TROOT::GetFile(const char *name) const
{
// Return pointer to file with name.

R__LOCKGUARD(gROOTMutex);
return (TFile*)GetListOfFiles()->FindObject(name);
}

Expand Down
7 changes: 6 additions & 1 deletion io/sql/src/TSQLFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
#include "TProcessID.h"
#include "TError.h"
#include "TClass.h"
#include "TVirtualMutex.h"

#include "TSQLServer.h"
#include "TSQLTableInfo.h"
Expand Down Expand Up @@ -706,6 +707,7 @@ void TSQLFile::Close(Option_t *option)
}
pidDeleted.Delete();

R__LOCKGUARD(gROOTMutex);
gROOT->GetListOfFiles()->Remove(this);
}

Expand Down Expand Up @@ -1049,7 +1051,10 @@ void TSQLFile::InitSqlDatabase(Bool_t create)
}
}

gROOT->GetListOfFiles()->Add(this);
{
R__LOCKGUARD(gROOTMutex);
gROOT->GetListOfFiles()->Add(this);
}
cd();

fNProcessIDs = 0;
Expand Down
7 changes: 6 additions & 1 deletion io/xml/src/TXMLFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
#include "TProcessID.h"
#include "TError.h"
#include "TClass.h"
#include "TVirtualMutex.h"

ClassImp(TXMLFile);

Expand Down Expand Up @@ -295,7 +296,10 @@ void TXMLFile::InitXmlFile(Bool_t create)
ReadFromFile();
}

gROOT->GetListOfFiles()->Add(this);
{
R__LOCKGUARD(gROOTMutex);
gROOT->GetListOfFiles()->Add(this);
}
cd();

fNProcessIDs = 0;
Expand Down Expand Up @@ -358,6 +362,7 @@ void TXMLFile::Close(Option_t *option)
}
pidDeleted.Delete();

R__LOCKGUARD(gROOTMutex);
gROOT->GetListOfFiles()->Remove(this);
}

Expand Down
23 changes: 15 additions & 8 deletions tree/treeplayer/src/TTreePlayer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include "TVirtualMonitoring.h"
#include "TTreeCache.h"
#include "TStyle.h"
#include "TVirtualMutex.h"

#include "HFitInterface.h"
#include "Foption.h"
Expand Down Expand Up @@ -1141,10 +1142,13 @@ Int_t TTreePlayer::MakeClass(const char *classname, const char *option)
fprintf(fp," // of trees.\n");
fprintf(fp," TChain * chain = new TChain(\"%s\",\"%s\");\n",
fTree->GetName(),fTree->GetTitle());
TIter next(((TChain*)fTree)->GetListOfFiles());
TChainElement *element;
while ((element = (TChainElement*)next())) {
fprintf(fp," chain->Add(\"%s/%s\");\n",element->GetTitle(),element->GetName());
{
R__LOCKGUARD(gROOTMutex);
TIter next(((TChain*)fTree)->GetListOfFiles());
TChainElement *element;
while ((element = (TChainElement*)next())) {
fprintf(fp," chain->Add(\"%s/%s\");\n",element->GetTitle(),element->GetName());
}
}
fprintf(fp," tree = chain;\n");
fprintf(fp,"#endif // SINGLE_TREE\n\n");
Expand Down Expand Up @@ -1582,10 +1586,13 @@ Int_t TTreePlayer::MakeCode(const char *filename)
fprintf(fp," // of trees.\n");
fprintf(fp," TChain *%s = new TChain(\"%s\",\"%s\");\n",
fTree->GetName(),fTree->GetName(),fTree->GetTitle());
TIter next(((TChain*)fTree)->GetListOfFiles());
TChainElement *element;
while ((element = (TChainElement*)next())) {
fprintf(fp," %s->Add(\"%s/%s\");\n",fTree->GetName(),element->GetTitle(),element->GetName());
{
R__LOCKGUARD(gROOTMutex);
TIter next(((TChain*)fTree)->GetListOfFiles());
TChainElement *element;
while ((element = (TChainElement*)next())) {
fprintf(fp," %s->Add(\"%s/%s\");\n",fTree->GetName(),element->GetTitle(),element->GetName());
}
}
fprintf(fp,"#endif // SINGLE_TREE\n\n");
}
Expand Down