Harlequin RIP SDK

Spinlocks implemented using atomic operations. More...

#include "platform.h"
#include "hqatomic.h"
#include "hqwindows.h"

Macros

#define yield_processor()   (void)SwitchToThread()
 Yield the processor to another thread, if there is one runnable.
 
#define spinlock_pointer(addr_, locked_, count_)
 Lock a pointer using atomic operations. More...
 
#define spinlock_pointer_incomplete(addr_, locked_, count_)
 Lock a pointer using atomic operations. More...
 
#define spintrylock_pointer(addr_, locked_, didlock_)
 Try to lock a pointer using atomic operations. More...
 
#define spinunlock_pointer(addr_, unlocked_)
 Unlock a pointer using atomic operations. More...
 
#define spinunlock_pointer_incomplete(addr_, unlocked_)
 Unlock a pointer using atomic operations. More...
 
#define spin_pointer_without_lock(ptr_, uptr_)
 Get the value of a potentially spinlocked pointer in its unlocked state. More...
 
#define spinlock_counter(addr_, count_)
 Lock a counter semaphore using atomic operations. More...
 
#define spinunlock_counter(addr_)
 Unlock a semaphore counter using atomic operations. More...
 

Typedefs

typedef void * __attribute__((__may_alias__)) spinlock_void_ptr
 Aliased void pointer, to quieten GCC warnings and prevent harmful optimisations.
 

Enumerations

enum  { HQSPIN_YIELD_NEVER = 0 , HQSPIN_YIELD_ALWAYS = 1 }
 Constants for yields per spinlock cycle. More...
 

Detailed Description

Spinlocks implemented using atomic operations.

Copyright (C) 2024 Global Graphics Software Ltd. All rights reserved. This source code contains the confidential and trade secret information of Global Graphics Software Ltd. It may not be used, copied or distributed for any reason except as set forth in the applicable Global Graphics license agreement.

These spinlocks are implemented in a separate file because they include platform-specific header files to yield the processor in the event of a contended spinlock