Skip to content

Commit 122814a

Browse files
committed
Add missing in TClass::GetClass with a ClassInfo.
1 parent 880c054 commit 122814a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/meta/src/TClass.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,6 +3178,12 @@ TClass *TClass::GetClass(ClassInfo_t *info, Bool_t load, Bool_t silent)
31783178
if (!info || !gCling->ClassInfo_IsValid(info)) return 0;
31793179
if (!gROOT->GetListOfClasses()) return 0;
31803180

3181+
// Technically we need the write lock only for the call to ClassInfo_FullName
3182+
// and GenerateTClass but FindObject will take the read lock (and LoadClass will
3183+
// take the write lock). Since taking/releasing the lock is expensive, let just
3184+
// take the write guard and keep it.
3185+
R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
3186+
31813187
// Get the normalized name.
31823188
TString name( gCling->ClassInfo_FullName(info) );
31833189

0 commit comments

Comments
 (0)