|
Aria
2.8.0
|
This is like ArASyncTask, but instead of runThread it uses a functor to run. More...
#include <ArFunctorASyncTask.h>
Inherits ArASyncTask.
Public Member Functions | |
| ArFunctorASyncTask (ArRetFunctor1< void *, void *> *functor) | |
| Constructor. | |
| virtual void * | runThread (void *arg) |
| Our reimplementation of runThread. | |
| virtual | ~ArFunctorASyncTask () |
| Destructor. | |
Public Member Functions inherited from ArASyncTask | |
| ArASyncTask () | |
| Constructor. | |
| virtual int | create (bool joinable=true, bool lowerPriority=true) |
| Create the task and start it going. | |
| virtual const char * | getThreadActivity (void) |
| Gets a string that describes what the thread is doing, or NULL if it doesn't know. More... | |
| virtual void | run (void) |
| Run without creating a new thread. More... | |
| virtual void | runAsync (void) |
| Run in its own thread. | |
| virtual void * | runInThisThread (void *arg=0) |
| Internal function used with system threading system to run the new thread. More... | |
| virtual void | stopRunning (void) |
| Stop the thread. | |
| virtual | ~ArASyncTask () |
| Destructor. | |
Public Member Functions inherited from ArThread | |
| ArThread (bool blockAllSignals=true) | |
| Constructor. | |
| ArThread (ThreadType thread, bool joinable, bool blockAllSignals=true) | |
| Constructor - starts the thread. | |
| ArThread (ArFunctor *func, bool joinable=true, bool blockAllSignals=true) | |
| Constructor - starts the thread. | |
| virtual void | cancel (void) |
| Cancel the thread. | |
| virtual int | detach (void) |
| Detatch the thread so it cant be joined. | |
| bool | getBlockAllSignals (void) |
| Do we block all process signals at startup? | |
| virtual ArFunctor * | getFunc (void) const |
| Get the functor that the thread runs. | |
| virtual bool | getJoinable (void) const |
| Get the joinable status of the thread. | |
| virtual ThreadType | getOSThread (void) const |
| Get the underlying os thread type. | |
| pid_t | getPID (void) |
| virtual bool | getRunning (void) const |
| Get the running status of the thread. | |
| virtual bool | getRunningWithLock (void) |
| Get the running status of the thread, locking around the variable. | |
| virtual const ThreadType * | getThread (void) const |
| Get the underlying thread type. | |
| virtual const char * | getThreadName (void) |
| Gets the name of the thread. | |
| pid_t | getTID (void) |
| virtual bool | isThreadFinished () const |
| Returns whether the thread has been completed and can be deleted. More... | |
| virtual bool | isThreadStarted () const |
| Returns whether the thread has been started. More... | |
| virtual int | join (void **ret=NULL) |
| Join on the thread. | |
| int | lock (void) |
| Lock the thread instance. More... | |
| virtual void | logThreadInfo (void) |
| Logs the information about this thread. | |
| virtual void | setRunning (bool running) |
| Set the running value on the thread. | |
| virtual void | setThreadName (const char *name) |
| Sets the name of the thread. | |
| virtual void | threadFinished (void) |
| Marks the thread as finished and logs useful debugging information. More... | |
| virtual void | threadStarted (void) |
| Marks the thread as started and logs useful debugging information. More... | |
| int | tryLock (void) |
| Try to lock the thread instance without blocking. More... | |
| int | unlock (void) |
| Unlock the thread instance. More... | |
| virtual | ~ArThread () |
| Destructor. | |
Protected Attributes | |
| ArRetFunctor1< void *, void * > * | myFunc |
Protected Attributes inherited from ArThread | |
| bool | myBlockAllSignals |
| bool | myFinished |
| ArFunctor * | myFunc |
| bool | myJoinable |
| ArMutex | myMutex |
| std::string | myName |
| pid_t | myPID |
| bool | myRunning |
| State variable to denote when the thread should continue or exit. | |
| bool | myStarted |
| ArStrMap | myStrMap |
| ThreadType | myThread |
| pid_t | myTID |
Additional Inherited Members | |
Public Types inherited from ArThread | |
| typedef std::map< ThreadType, ArThread * > | MapType |
| enum | Status { STATUS_FAILED =1, STATUS_NORESOURCE, STATUS_NO_SUCH_THREAD, STATUS_INVALID, STATUS_JOIN_SELF, STATUS_ALREADY_DETATCHED } |
| typedef pthread_t | ThreadType |
Static Public Member Functions inherited from ArThread | |
| static void | cancelAll (void) |
| Cancel all threads. | |
| static ArLog::LogLevel | getLogLevel (void) |
| Gets the logging level for thread information. | |
| static ThreadType | getThisOSThread (void) |
| Get the underlying os thread type of this thread. | |
| static const ThreadType * | getThisThread (void) |
| Get the underlying thread type of this thread. | |
| static const char * | getThisThreadName (void) |
| Gets the name of the this thread. | |
| static void | init (void) |
| Initialize the internal book keeping structures. More... | |
| static void | joinAll (void) |
| Join on all threads. | |
| static ThreadType | osSelf (void) |
| Returns the os self of the current thread. More... | |
| static ArThread * | self (void) |
| Returns the instance of your own thread (the current one) More... | |
| static void | setLogLevel (ArLog::LogLevel level) |
| Sets the logging level for thread information. | |
| static void | shutdown () |
| Shuts down and deletes the last remaining thread; call after joinAll. | |
| static void | stopAll () |
| Stop all threads. | |
| static void | yieldProcessor (void) |
| Yield the processor to another thread. | |
Protected Member Functions inherited from ArThread | |
| virtual int | doJoin (void **ret=NULL) |
Static Protected Member Functions inherited from ArThread | |
| static void | addThreadToMap (ThreadType pt, ArThread *at) |
| static ArThread * | findThreadInMap (ThreadType t) |
| static void | removeThreadFromMap (ThreadType t) |
Static Protected Attributes inherited from ArThread | |
| static ArLog::LogLevel | ourLogLevel = ArLog::Verbose |
| static MapType | ourThreads |
| static ArMutex | ourThreadsMutex |
| static std::string | ourUnknownThreadName = "unknown" |
This is like ArASyncTask, but instead of runThread it uses a functor to run.