HyperDbg Debugger
Loading...
Searching...
No Matches
Spinlock.h
Go to the documentation of this file.
1
12#pragma once
13
15// Spinlock Functions //
17
19SpinlockTryLock(volatile LONG * Lock);
20
22SpinlockCheckLock(volatile LONG * Lock);
23
24void
25SpinlockLock(volatile LONG * Lock);
26
27void
28SpinlockLockWithCustomWait(volatile LONG * Lock, unsigned MaxWait);
29
30void
31SpinlockUnlock(volatile LONG * Lock);
32
33void
35 LONG volatile * Destination,
36 LONG Exchange,
37 LONG Comperand);
38
39#define ScopedSpinlock(LockObject, CodeToRun) \
40 MetaScopedExpr(SpinlockLock(&LockObject), \
41 SpinlockUnlock(&LockObject), \
42 CodeToRun)
UCHAR BOOLEAN
Definition BasicTypes.h:39
void SpinlockLock(volatile LONG *Lock)
Tries to get the lock and won't return until successfully get the lock.
Definition Spinlock.c:52
BOOLEAN SpinlockTryLock(volatile LONG *Lock)
Tries to get the lock otherwise returns.
Definition Spinlock.c:41
void SpinlockUnlock(volatile LONG *Lock)
Release the lock.
Definition Spinlock.c:158
void SpinlockInterlockedCompareExchange(LONG volatile *Destination, LONG Exchange, LONG Comperand)
Interlocked spinlock that tries to change the value and makes sure that it changed the target value.
Definition Spinlock.c:88
void SpinlockLockWithCustomWait(volatile LONG *Lock, unsigned MaxWait)
Tries to get the lock and won't return until successfully get the lock.
Definition Spinlock.c:125
BOOLEAN SpinlockCheckLock(volatile LONG *Lock)
Check the lock without changing the state.
Definition Spinlock.c:169