A base class for threaded jobs.
More...
|
override void | Start (bool backgroundThread, System.Threading.ThreadPriority priority) |
| Start the work process. This should initialize the Thread with the Run function. More...
|
|
virtual bool | Check () |
| Checks if the Job is done, and facilitates calling OnFinished when completed. More...
|
|
|
override void | Abort () |
| Abort the Job (as best we can). More...
|
|
virtual void | OnFinished () |
| Called once by Check when the Job has finished. More...
|
|
virtual void | Run (object state) |
| The launcher of the ThreadedFunction, used to handle the state as well. More...
|
|
virtual void | ThreadedFunction () |
| The work horse function that MUST BE THREAD SAFE. Do not touch the Unity API! It will cause an exception if you do, and things will act like a 4 year old having a tantrum. Debugging should be handled via System.Console and you should be aware that exceptions will not show up in Unity if they happen on the thread; therefore you will never know if its broken so test your code outside of the threading first, or have copius amounts of debugging implemented. More...
|
|
A base class for threaded jobs.
Definition at line 34 of file ThreadedJob.cs.
override void Hydrogen.Threading.ThreadedJob.Abort |
( |
| ) |
|
|
protectedvirtual |
override void Hydrogen.Threading.ThreadedJob.Start |
( |
bool |
backgroundThread, |
|
|
System.Threading.ThreadPriority |
priority |
|
) |
| |
|
virtual |
Start the work process. This should initialize the Thread with the Run function.
- Parameters
-
backgroundThread | If set to true background thread. |
priority | Priority. |
Implements Hydrogen.Threading.JobBase.
Definition at line 55 of file ThreadedJob.cs.
58 _thread =
new System.Threading.Thread (
Run);
61 _thread.IsBackground = backgroundThread;
64 _thread.Priority = priority;
virtual void Run(object state)
The launcher of the ThreadedFunction, used to handle the state as well.
System.Threading.Thread Hydrogen.Threading.ThreadedJob.Thread |
|
get |