12 #ifndef __UT_TASKSCOPE_H_INCLUDED__
13 #define __UT_TASKSCOPE_H_INCLUDED__
25 #define UT_TASKSCOPE_DBG(ZZ) UT_DBGOUT(ZZ)
27 #define UT_TASKSCOPE_DBG(ZZ)
31 #define UT_INVALID_TASK_ID 0
49 myOldTaskScope = theTaskScope.getValueForThread(myThreadId);
50 theTaskScope.getValueForThread(myThreadId) =
this;
52 this, parent, myThreadId));
62 myOldTaskScope = theTaskScope.getValueForThread(myThreadId);
63 theTaskScope.getValueForThread(myThreadId) =
this;
65 this, parent, myThreadId));
74 if (myPerfMonEventId >= 0)
77 theTaskScope.getValueForThread(
SYSgetSTID()) = myOldTaskScope;
94 return theTaskScope.getValueForThread(thread);
107 const UT_TaskScope * &task = theTaskScope.getValueForThread(thread);
124 const UT_TaskScope * &task = theTaskScope.getValueForThread(thread);
145 task != NULL; task = task->getParent())
157 int myPerfMonEventId;
160 static ut_TaskScopeTLS theTaskScope;
163 #endif // __UT_TASKSCOPE_H_INCLUDED__
static const UT_TaskScope & getOrCreateCurrent()
static const UT_TaskScope * getCurrent()
static const UT_TaskScope * getCurrent(int thread)
GU_API GA_Offset getParent(const GU_Detail *gdp, const GA_Offset &node)
#define UT_TASKSCOPE_DBG(ZZ)
int getThreadId() const
Return the id of the assigned thread.
static const UT_TaskScope & getOrCreateRoot()
const UT_TaskScope * getParent() const
Return the parent of this task scope.
UT_TaskScope(const UT_TaskScope *parent, int thread)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
static const UT_TaskScope & getOrCreateRoot(int thread)
UT_ValArray< const UT_TaskScope * > UT_TaskScopePtrArray
Array of UT_TaskScope pointers.
bool isAncestor(const UT_TaskScope &parent) const
Test if the given task scope is an ancestor of ours.
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
UT_TaskScope(const UT_TaskScope *parent)
static const UT_TaskScope & getOrCreateCurrent(int thread)