GLib.atomic_int_exchange_and_add
Description: Reference for GLib.atomic_int_exchange_and_add

### Function

# GLibatomic_int_exchange_and_add

deprecated: 2.30 since: 2.4

#### Declaration [src]

    gint
    g_atomic_int_exchange_and_add (
      volatile gint* atomic,
      gint val
    )

#### Description [src]

This function existed before `g_atomic_int_add()` returned the prior value of the integer (which it now does). It is retained only for compatibility reasons. Don’t use this function in new code.

Available since: 2.4

Deprecated since: 2.30

Use `g_atomic_int_add()` instead.

#### Parameters

`atomic`

  Type: `volatile gint*`

  A pointer to a #gint.

  The data is owned by the caller of the function.

`val`

  Type: `gint`

  The value to add.

#### Return value

Type: `gint`

The value of `atomic` before the add, signed.