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
20
44int 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
85int CPLAtomicCompareAndExchange(volatile int *ptr, int oldval, int newval);
86
88
89#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:289
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285