* Spawn a thread if possible and run the link graph job in the thread. If * that's not possible run the job right now in the current thread. */
| 57 | * that's not possible run the job right now in the current thread. |
| 58 | */ |
| 59 | void LinkGraphJob::SpawnThread() |
| 60 | { |
| 61 | if (!StartNewThread(&this->thread, "ottd:linkgraph", &(LinkGraphSchedule::Run), this)) { |
| 62 | /* Of course this will hang a bit. |
| 63 | * On the other hand, if you want to play games which make this hang noticeably |
| 64 | * on a platform without threads then you'll probably get other problems first. |
| 65 | * OK: |
| 66 | * If someone comes and tells me that this hangs for them, I'll implement a |
| 67 | * smaller grained "Step" method for all handlers and add some more ticks where |
| 68 | * "Step" is called. No problem in principle. */ |
| 69 | LinkGraphSchedule::Run(this); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Join the calling thread with this job's thread if threading is enabled. |
no test coverage detected