CRYPTO_atomic_add

Atomically add amount to *val, optionally under lock.

Synopsis

Declared in <openssl/crypto.h>

int
CRYPTO_atomic_add(
    int* val,
    int amount,
    int* ret,
    CRYPTO_RWLOCK* lock);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
valInteger to modify in place.
amountValue added to *val.
retReceives the post-add value of *val; must not be NULL.
lockOptional CRYPTO_RWLOCK used when hardware atomics are unavailable, or NULL.