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