mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-06 18:54:02 +00:00
[c-host] dxgi: interlock so we can map outside of the capture thread
This commit is contained in:
@@ -25,6 +25,12 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#define INTERLOCKED_DEC(x) __sync_fetch_and_sub((x), 1)
|
||||
#define INTERLOCKED_GET(x) __sync_fetch_and_add((x), 0)
|
||||
#define INTERLOCKED_CE(x, c, v) __sync_val_compare_and_swap((x), (c), (v))
|
||||
|
||||
#define INTERLOCKED_SECTION(lock, x) \
|
||||
while(__sync_lock_test_and_set(&(lock), 1)) while((lock)); \
|
||||
x\
|
||||
__sync_lock_release(&this->deviceContextLock);
|
||||
|
||||
#else
|
||||
#define INTERLOCKED_OR8 InterlockedOr8
|
||||
#define INTERLOCKED_AND8 InterlockedAnd8
|
||||
@@ -32,4 +38,4 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#define INTERLOCKED_DEC InterlockedDecrement
|
||||
#define INTERLOCKED_GET(x) InterlockedAdd((x), 0)
|
||||
#define INTERLOCKED_CE(x, c, v) InterlockedCompareExchange((x), (v), (c))
|
||||
#endif
|
||||
#endif
|
Reference in New Issue
Block a user