GDAL
cpl_atomic_ops.h
1/**********************************************************************
2 * $Id$
3 *
4 * Name: cpl_atomic_ops.h
5 * Project: CPL - Common Portability Library
6 * Purpose: Atomic operation functions.
7 * Author: Even Rouault, <even dot rouault at spatialys.com>
8 *
9 **********************************************************************
10 * Copyright (c) 2009-2010, Even Rouault <even dot rouault at spatialys.com>
11 *
12 * SPDX-License-Identifier: MIT
13 ****************************************************************************/
14
15#ifndef CPL_ATOMIC_OPS_INCLUDED
16#define CPL_ATOMIC_OPS_INCLUDED
17
18#include "cpl_port.h"
19
21
45int CPL_DLL CPLAtomicAdd(volatile int *ptr, int increment);
46
56#define CPLAtomicInc(ptr) CPLAtomicAdd(ptr, 1)
57
67#define CPLAtomicDec(ptr) CPLAtomicAdd(ptr, -1)
68
86int CPLAtomicCompareAndExchange(volatile int *ptr, int oldval, int newval);
87
89
90#endif /* CPL_ATOMIC_OPS_INCLUDED */
Core portability definitions for CPL.
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:283
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:279