aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/jemalloc/spinlock.h
blob: 26532baebb64683ed2c6f2b5122082541ec094c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include <util/system/defaults.h> 

typedef volatile intptr_t spinlock_t; 
 
#define SPIN_L AllocAcquireAdaptiveLock
#define SPIN_U AllocReleaseAdaptiveLock

#define    _SPINLOCK_INITIALIZER 0
#define _SPINUNLOCK(_lck)     SPIN_U(_lck)
#define    _SPINLOCK(_lck)       SPIN_L(_lck)

#if defined(__cplusplus)
extern "C" {
#endif
    void SPIN_L(spinlock_t* lock);
    void SPIN_U(spinlock_t* lock);
#if defined(__cplusplus)
};
#endif