Newton Dynamics  4.00
ndThreadBackgroundWorker Class Reference
Inheritance diagram for ndThreadBackgroundWorker:
ndThreadPool ndList< ndBackgroundTask *, ndContainersFreeListAlloc< ndBackgroundTask * > > ndSyncMutex ndThread ndClassAlloc ndClassAlloc ndThreadName ndSemaphore ndAtomic< bool >

Public Member Functions

D_CORE_API void Terminate ()
 
D_CORE_API void SendTask (ndBackgroundTask *const job)
 
- Public Member Functions inherited from ndThreadPool
D_CORE_API ndThreadPool (const char *const baseName)
 
ndInt32 GetThreadCount () const
 
D_CORE_API void SetThreadCount (ndInt32 count)
 
D_CORE_API void TickOne ()
 
D_CORE_API void Begin ()
 
D_CORE_API void End ()
 
template<typename Function >
void ParallelExecute (const Function &ndFunction)
 
- Public Member Functions inherited from ndSyncMutex
D_CORE_API ndSyncMutex ()
 Create and initialize counter to zero.
 
D_CORE_API ~ndSyncMutex ()
 Destroy mutex.
 
D_CORE_API void Sync ()
 Synchronize with another worker threads. More...
 
D_CORE_API void Tick ()
 Increment internal variable m_count by one.
 
D_CORE_API void Release ()
 Decrement internal variable m_count by one and signal the thread to wakeup.
 
- Public Member Functions inherited from ndThread
D_CORE_API ndThread ()
 Empty default constructor after creation all threads go to a wait state.
 
virtual D_CORE_API ~ndThread ()
 Empty, does not terminate the thread loop. More...
 
D_CORE_API void SetName (const char *const name)
 Set thread name. More...
 
D_CORE_API void Signal ()
 Set the thread, to execute one call to and go back to a wait state

 
D_CORE_API void Finish ()
 Force the thread loop to terminate. More...
 
- Public Member Functions inherited from ndClassAlloc
 ndClassAlloc ()
 Empty default constructor.
 
 ~ndClassAlloc ()
 Empty.
 
- Public Member Functions inherited from ndSemaphore
D_CORE_API ndSemaphore ()
 Create and initialize counter to zero.
 
D_CORE_API ~ndSemaphore ()
 Destroy semaphore.
 
D_CORE_API ndInt32 GetCount () const
 Returns counter counter value.
 
D_CORE_API bool Wait ()
 Synchronize with another threads. More...
 
D_CORE_API void Signal ()
 Notify a thread blocked by member function Wait to wake and test m_counter again. More...
 
D_CORE_API void Terminate ()
 Notify a waiting thread on member function Wait that is time to exit the thread loop.
 
- Public Member Functions inherited from ndAtomic< bool >
 ndAtomic (bool val)
 
 ndAtomic (const ndAtomic< bool > &copy)
 
bool operator= (bool value)
 
- Public Member Functions inherited from ndList< ndBackgroundTask *, ndContainersFreeListAlloc< ndBackgroundTask * > >
 operator ndInt32 () const
 
ndInt32 GetCount () const
 
ndNode * GetLast () const
 
ndNode * GetFirst () const
 
ndNode * Append ()
 
ndNode * Append (ndNode *const node)
 
ndNode * Append (const ndBackgroundTask * &element)
 
ndNode * Addtop ()
 
ndNode * Addtop (ndNode *const node)
 
ndNode * Addtop (const ndBackgroundTask * &element)
 
void RotateToEnd (ndNode *const node)
 
void RotateToBegin (ndNode *const node)
 
void InsertAfter (ndNode *const root, ndNode *const node)
 
void InsertBefore (ndNode *const root, ndNode *const node)
 
ndNode * Find (const ndBackgroundTask * &element) const
 
ndNode * GetNodeFromInfo (ndBackgroundTask * &m_info) const
 
void Remove (ndNode *const node)
 
void Remove (const ndBackgroundTask * &element)
 
void RemoveAll ()
 
void Merge (ndList< ndBackgroundTask *, ndContainersFreeListAlloc< ndBackgroundTask * > > &list)
 
void Unlink (ndNode *const node)
 
bool SanityCheck () const
 

Additional Inherited Members

- Static Public Member Functions inherited from ndThreadPool
static D_CORE_API ndInt32 GetMaxThreads ()
 
- Static Public Member Functions inherited from ndClassAlloc
D_OPERATOR_NEW_AND_DELETE static D_CORE_API void * Malloc (size_t size)
 Generic allocation for any function subclass from ndClassAlloc.
 
static D_CORE_API void Free (void *const ptr)
 Generic destruction for any function subclass from ndClassAlloc.
 
- Static Public Member Functions inherited from ndList< ndBackgroundTask *, ndContainersFreeListAlloc< ndBackgroundTask * > >
static void FlushFreeList ()
 
- Public Attributes inherited from ndThreadName
char m_name [32]