> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# QSH Worker

**Header:** `utils/inc/qshWorker.h`

## Structures

### `qshWorker`

Implementation of a worker thread with its own task-queue.

#### Functions

##### `qshWorker`

creates a worker thread and starts processing tasks

```cpp theme={null}
 qshWorker()
```

##### `~qshWorker`

terminates the worker thread, after shutting it down

```cpp theme={null}
 ~qshWorker()
```

##### `shutdownWorker`

Signals the worker thread to stop processing tasks, waits until the thread completes execution.

```cpp theme={null}
void shutdownWorker()
```

##### `setName`

```cpp theme={null}
void setName(const char *name)
```

##### `addTask`

add a new task for the worker to do

Tasks are performed in order in which they are added

```cpp theme={null}
void addTask(const workerTask &task)
```

**Parameters**

<ParamField path="task" type="const workerTask &">
  task to perform
</ParamField>

## Type Definitions

### `workerTask`

type alias for worker's task function

```cpp theme={null}
typedef std::function< void()> workerTask
```

## Macros

### `UNUSED`

```c theme={null}
#define UNUSED (void)(x)
```
