aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/deprecated/galloc/spinlock.h
blob: 93fcf10e12a3d214c8101e2b3a91d203e53a077c (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