A++ » INCLUDE » TThread

class TThread: public TNamed


TThread

This class implements threads. A thread is an execution environment
much lighter than a process. A single process can have multiple
threads. The actual work is done via the TThreadImp class (either
TPosixThread or TWin32Thread).


Function Members (Methods)

public:
virtual~TThread()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static Int_tCancelPoint()
static TClass*Class()
virtual const char*TObject::ClassName() const
static Int_tCleanUp()
static Int_tCleanUpPop(Int_t exe = 0)
static Int_tCleanUpPush(void* free, void* arg = 0)
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidDelete(Option_t* option = "")
static Int_tDelete(TThread*& th)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
static Int_tExists()
static Int_tExit(void* ret = 0)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
Long_tGetId() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TThread::EPriorityGetPriority() const
TThread::EStateGetState() const
static TThread*GetThread(Long_t id)
static TThread*GetThread(const char* name)
static Int_tGetTime(ULong_t* absSec, ULong_t* absNanoSec)
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
static voidInitialize()
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
static Bool_tIsInitialized()
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
Long_tJoin(void** ret = 0)
static Long_tJoin(Long_t id, void** ret = 0)
Int_tKill()
static Int_tKill(Long_t id)
static Int_tKill(const char* name)
static Int_tLock()
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
static voidPrintf(const char* fmt)
static voidPs()
static voidps()
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
Int_tRun(void* arg = 0)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
static TThread*Self()
static Long_tSelfId()
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
static Int_tSetCancelAsynchronous()
static Int_tSetCancelDeferred()
static Int_tSetCancelOff()
static Int_tSetCancelOn()
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetPriority(TThread::EPriority pri)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
static Int_tSleep(ULong_t secs, ULong_t nanos = 0)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
static Int_tTryLock()
static void**Tsd(void* dflt, Int_t k)
TThread(Long_t id = 0)
TThread(TThread::VoidRtnFunc_t fn, void* arg = 0, TThread::EPriority pri = kNormalPriority)
TThread(TThread::VoidFunc_t fn, void* arg = 0, TThread::EPriority pri = kNormalPriority)
TThread(const char* thname, TThread::VoidRtnFunc_t fn, void* arg = 0, TThread::EPriority pri = kNormalPriority)
TThread(const char* thname, TThread::VoidFunc_t fn, void* arg = 0, TThread::EPriority pri = kNormalPriority)
static Int_tUnLock()
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
static voidXAction()
protected:
voidTObject::MakeZombie()
private:
static voidAfterCancel(TThread* th)
voidConstructor()
virtual voidDoError(Int_t level, const char* location, const char* fmt, va_list va) const
voidErrorHandler(int level, const char* location, const char* fmt, va_list ap) const
static void*Function(void* ptr)
static void**GetTls(Int_t k)
static voidInit()
TThread&operator=(const TThread&)
voidSetComment(const char* txt = 0)
TThread(const TThread&)
static Int_tXARequest(const char* xact, Int_t nb, void** ar, Int_t* iret)

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TThread::EStatekCanceledState
static TThread::EStatekCancelingState
static TObject::EStatusBitsTObject::kCannotPick
static TThread::EStatekDeletingState
static TThread::EStatekFinishedState
static TObject::EStatusBitsTObject::kHasUUID
static TThread::EPrioritykHighPriority
static TObject::EStatusBitsTObject::kInvalidObject
static TThread::EStatekInvalidState
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TThread::EPrioritykLowPriority
static TObject::EStatusBitsTObject::kMustCleanup
static TThread::EStatekNewState
static TObject::EStatusBitsTObject::kNoContextMenu
static TThread::EPrioritykNormalPriority
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TThread::EStatekRunningState
static TObject::(anonymous)TObject::kSingleKey
static TThread::EStatekTerminatedState
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
private:
void*fCleansupport of cleanup structure
charfComment[100]thread specific state comment
Bool_tfDetachedkTRUE if thread is Detached
TThread::VoidRtnFunc_tfFcnRetnvoid* start function of thread
TThread::VoidFunc_tfFcnVoidvoid start function of thread
Long_tfHandleWin32 thread handle
TThread**fHolderpointer to holder of this (delete only)
Long_tfIdthread id
Bool_tfNamedkTRUE if thread is Named
TThread*fNextpointer to next thread
TThread*fPrevpointer to prev thread
TThread::EPriorityfPrioritythread priority
TThread::EStatefStatethread state
TThread::EStatefStateComingcoming thread state
void*fThreadArgthread start function arguments
static TThread*fgMainpointer to chain of TThread's
static Long_tfgMainIdthread id of main thread
static TMutex*fgMainMutexmutex to protect chain of threads
static TThreadImp*fgThreadImpstatic pointer to thread implementation
static char*volatilefgXActAction name to do by main thread
static TCondition*fgXActCondicondition for XAction
static TMutex*fgXActMutexmutex to protect XAction
static volatile Int_tfgXAnbsize of array above
static void**volatilefgXArrpointer to control array of void pointers for action
static volatile Int_tfgXArtreturn XA flag

Class Charts

Inheritance Chart:
TObject
TNamed
TThread

Function documentation

void Constructor()
 Private Member functions
void SetComment(const char* txt = 0)
void DoError(Int_t level, const char* location, const char* fmt, va_list va) const
void ErrorHandler(int level, const char* location, const char* fmt, va_list ap) const
void Init()
void * Function(void* ptr)
Int_t XARequest(const char* xact, Int_t nb, void** ar, Int_t* iret)
void AfterCancel(TThread* th)
void ** GetTls(Int_t k)
TThread(const TThread& )
TThread& operator=(const TThread& )
TThread(VoidRtnFunc_t fn, void *arg = 0, EPriority pri = kNormalPriority)
TThread(VoidFunc_t fn, void *arg = 0, EPriority pri = kNormalPriority)
TThread(const char *thname, VoidRtnFunc_t fn, void *arg = 0, EPriority pri = kNormalPriority)
TThread(const char *thname, VoidFunc_t fn, void *arg = 0, EPriority pri = kNormalPriority)
TThread(Long_t id = 0)
virtual ~TThread()
Int_t Kill()
Int_t Run(void* arg = 0)
void SetPriority(TThread::EPriority pri)
void Delete(Option_t* option = "")
{ TObject::Delete(option); }
EPriority GetPriority() const
{ return fPriority; }
EState GetState() const
{ return fState; }
Long_t GetId() const
{ return fId; }
void Ps()
void ps()
{ Ps(); }
void Initialize()
Bool_t IsInitialized()
Long_t Join(void** ret = 0)
Long_t Join(Long_t id, void** ret = 0)
Int_t Exit(void* ret = 0)
Int_t Exists()
TThread * GetThread(Long_t id)
TThread * GetThread(const char* name)
Int_t Lock()
Int_t TryLock()
Int_t UnLock()
TThread * Self()
Long_t SelfId()
Int_t Sleep(ULong_t secs, ULong_t nanos = 0)
Int_t GetTime(ULong_t* absSec, ULong_t* absNanoSec)
Int_t Delete(TThread*& th)
void ** Tsd(void* dflt, Int_t k)
Int_t SetCancelOn()
 Cancellation
 there are two types of TThread cancellation:
    DEFERRED     - Cancellation only in user provided cancel-points
    ASYNCHRONOUS - In any point
    DEFERRED is more safe, it is DEFAULT.
Int_t SetCancelOff()
Int_t SetCancelAsynchronous()
Int_t SetCancelDeferred()
Int_t CancelPoint()
Int_t Kill(Long_t id)
Int_t Kill(const char* name)
Int_t CleanUpPush(void* free, void* arg = 0)
Int_t CleanUpPop(Int_t exe = 0)
Int_t CleanUp()
void Printf(const char *fmt, ...)
 XActions
void XAction()