aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/jemalloc/spinlock.h
blob: 1430b9bb8f5fb90abe5f1d860237b2d015f404d3 (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