# async.status (Shared)

> Tells what state an async thread of this resource is in.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Timers and async
- **URL**: https://wiki.mymp.gg/en/async.status

## Syntax

```lua
string async.status(any thread)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `thread` | `any` | A thread from `async.thread` or `async.mutex`. |

## Returns

`"suspended"` if it is paused, `"running"` if it is running, `"dead"` if it ended, was cancelled or is not an async thread of this resource.

## Example

```lua
local loader = async.thread(function()
    async.wait(5000)
end)

setTimer(function()
    outputDebugString("loader is " .. async.status(loader))
end, 1000, 1)
```

## See also

- [async.cancel (Shared)](https://wiki.mymp.gg/en/async.cancel.md): Stops an async thread of this resource. A paused thread ends at once; called from the thread itself, it stops right there.
- [async.thread (Shared)](https://wiki.mymp.gg/en/async.thread.md): Runs a function in a new async thread, right away. The call returns when the function ends or first pauses, as with async.wait.
