# Tasklets

# Tasklets

This module includes functions that control the Thread stack's execution.

## Summary

| ### Functions ||
|---|---|
| `https://openthread.io/reference/group/api-tasklets#group__api-tasklets_1ga5fa143f9b7f9dc7a7e6310d01a1e90f4(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether or not OpenThread has tasklets pending. |
| `https://openthread.io/reference/group/api-tasklets#group__api-tasklets_1gabeac7ca15767acb57efc916458b9fb72(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Run all queued OpenThread tasklets at the time this is called. |
| `https://openthread.io/reference/group/api-tasklets#group__api-tasklets_1ga504d39f61afb73805cb9452695fdbdb0(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` OpenThread calls this function when the tasklet queue transitions from empty to non-empty. |

## Functions

### otTaskletsArePending

```
bool otTaskletsArePending(
  otInstance *aInstance
)
```
Indicates whether or not OpenThread has tasklets pending.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| Return Values | |---|---| | `TRUE` | If there are tasklets pending. | | `FALSE` | If there are no tasklets pending. | |

### otTaskletsProcess

```
void otTaskletsProcess(
  otInstance *aInstance
)
```
Run all queued OpenThread tasklets at the time this is called.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |

### otTaskletsSignalPending

```
void otTaskletsSignalPending(
  otInstance *aInstance
)
```
OpenThread calls this function when the tasklet queue transitions from empty to non-empty.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).