# interlocked\_increment

### Function

> interlocked\_increment

### Syntax

> interlocked\_increment( \*Variable );

### Parameters

**\[\*Variable (Addend)]**

A reference to a variable (most of the time a global variable) to be added by `1`.

### Description

Increments (increases by one) the value of the specified global variable as an atomic operation.

### Return value

The function returns the resulting incremented value.

### Examples

`Result = interlocked_increment(.my_gloabl_counter);`

Increments a global variable by **1** and saves the results into a local variable named `Result`.

### Remarks

None

### Related

[interlocked\_compare\_exchange](https://docs.hyperdbg.org/commands/scripting-language/functions/interlocked/interlocked_compare_exchange)

[interlocked\_decrement](https://docs.hyperdbg.org/commands/scripting-language/functions/interlocked/interlocked_decrement)

[interlocked\_exchange](https://docs.hyperdbg.org/commands/scripting-language/functions/interlocked/interlocked_exchange)

[interlocked\_exchange\_add](https://docs.hyperdbg.org/commands/scripting-language/functions/interlocked/interlocked_exchange_add)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hyperdbg.org/commands/scripting-language/functions/interlocked/interlocked_increment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
