86 std::atomic_flag_clear( &
fLock );
104 if (current && current->second ==
this) {
122 ::Warning(
"TProcessID::AddProcessID",
"Maximum number of TProcessID (65535) is almost reached (one left). TRef will stop being functional when the limit is reached.");
124 ::Fatal(
"TProcessID::AddProcessID",
"Maximum number of TProcessID (65535) has been reached. TRef are not longer functional.");
195 while (
fLock.test_and_set(std::memory_order_acquire));
197 fLock.clear(std::memory_order_release);
227 (*fObjects)[i] =
nullptr;
268 Int_t pid = (uid>>24)&0xff;
279 if (current && current->first == pid)
280 return current->second;
334 Int_t uid = uidd & 0xffffff;
393 if ( (obj->
GetUniqueID()&0xff000000)==0xff000000 ) {
427 (*fObjects)[uid] =
nullptr;
unsigned long long ULong64_t
static std::atomic< PIDCacheContent_t * > gGetProcessWithUIDCache
static std::atomic< TProcessID * > gIsValidCache
static ULong_t Void_Hash(const void *ptr)
Return hash value for this object.
std::pair< Int_t, TProcessID * > PIDCacheContent_t
R__EXTERN TVirtualMutex * gROOTMutex
#define R__LOCKGUARD_IMT(mutex)
#define R__WRITE_LOCKGUARD(mutex)
#define R__READ_LOCKGUARD(mutex)
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
This class stores a (key,value) pair using an external hash.
void Remove(ULong64_t hash, Long64_t key)
Remove entry with specified key from the TExMap.
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
Int_t IndexOf(const TObject *obj) const
Int_t GetEntriesFast() const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Int_t GetEntries() const
Return the number of objects in array (i.e.
TObject * UncheckedAt(Int_t i) const
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
Int_t GetLast() const
Return index of last object in array.
virtual TObject * Remove(TObject *obj)
Remove object from array.
TObject * At(Int_t idx) const
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
@ kIsReferenced
if object is referenced by a TRef or TRefArray
@ kMustCleanup
if object destructor must call RecursiveRemove()
A TProcessID identifies a ROOT job in a unique way in time and space.
Int_t IncrementCount()
Increase the reference count to this object.
void CheckInit()
Initialize fObjects.
static void Cleanup()
static function (called by TROOT destructor) to delete all TProcessIDs
static Bool_t IsValid(TProcessID *pid)
static function. return kTRUE if pid is a valid TProcessID
static UInt_t GetNProcessIDs()
Return the (static) number of process IDs.
virtual void Clear(Option_t *option="")
delete the TObjArray pointing to referenced objects this function is called by TFile::Close("R")
static TObjArray * fgPIDs
static TObjArray * GetPIDs()
static: returns array of TProcessIDs
static UInt_t AssignID(TObject *obj)
static function returning the ID assigned to obj If the object is not yet referenced,...
virtual void RecursiveRemove(TObject *obj)
called by the object destructor remove reference to obj from the current table if it is referenced
static TProcessID * GetSessionProcessID()
static function returning the pointer to the session TProcessID
void PutObjectWithID(TObject *obj, UInt_t uid=0)
stores the object at the uid th slot in the table of objects The object uniqued is set as well as its...
virtual ~TProcessID()
Destructor.
static TExMap * fgObjPIDs
static TProcessID * AddProcessID()
Static function to add a new TProcessID to the list of PIDs.
std::atomic_flag fLock
Array pointing to the referenced objects.
static TProcessID * GetProcessWithUID(const TObject *obj)
static function returning a pointer to TProcessID with its pid encoded in the highest byte of obj->Ge...
static TProcessID * GetProcessID(UShort_t pid)
static function returning a pointer to TProcessID number pid in fgPIDs
Int_t DecrementCount()
The reference fCount is used to delete the TProcessID in the TFile destructor when fCount = 0.
TObject * GetObjectWithID(UInt_t uid)
returns the TObject with unique identifier uid in the table of objects
static std::atomic_uint fgNumber
ROOT::Internal::TAtomicPointer< TObjArray * > fObjects
Reference count to this object (from TFile)
static TProcessID * fgPID
Spin lock for initialization of fObjects.
TProcessID()
Default constructor.
static UInt_t GetObjectCount()
Return the current referenced object count fgNumber is incremented every time a new object is referen...
static TProcessID * GetPID()
static: returns pointer to current TProcessID
static void SetObjectCount(UInt_t number)
static function to set the current referenced object count fgNumber is incremented every time a new o...
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
R__EXTERN TVirtualRWMutex * gCoreMutex