GDAL

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