# ThreadJoin

Waits for the given thread object to finish running

## Method Signature

```
ThreadJoin(threadName=[string], timeout=[numeric])
```

### Arguments

| Argument     | Type      | Required | Description                                                                                                                                                            | Default |
| ------------ | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `threadName` | `string`  | `false`  | <p>The name of the thread to join to the main thread.<br>This can be the name of the thread or a comma-separated list of thread names.</p>                             |         |
| `timeout`    | `numeric` | `false`  | The maximum time in milliseconds to wait for the thread to finish running. If the thread does not finish running within this time, the join operation will be aborted. | `0`     |

## Examples

## Related

* [AsyncAll](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/asyncall)
* [AsyncAllApply](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/asyncallapply)
* [AsyncAny](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/asyncany)
* [AsyncRun](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/asyncrun)
* [ExecutorDelete](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/executordelete)
* [ExecutorGet](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/executorget)
* [ExecutorHas](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/executorhas)
* [ExecutorList](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/executorlist)
* [ExecutorNew](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/executornew)
* [ExecutorShutdown](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/executorshutdown)
* [ExecutorStatus](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/executorstatus)
* [FutureNew](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/futurenew)
* [IsInThread](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/isinthread)
* [isThreadAlive](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/isthreadalive)
* [IsThreadInterrupted](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/isthreadinterrupted)
* [RunAsync](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/runasync)
* [ThreadInterrupt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/threadinterrupt)
* [ThreadNew](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/threadnew)
* [ThreadTerminate](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/async/threadterminate)
