summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bx/src/mutex.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bx/src/mutex.cpp')
-rw-r--r--3rdparty/bx/src/mutex.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/3rdparty/bx/src/mutex.cpp b/3rdparty/bx/src/mutex.cpp
index b3e9677e62b..0ef8597a8aa 100644
--- a/3rdparty/bx/src/mutex.cpp
+++ b/3rdparty/bx/src/mutex.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/mutex.h>
#if BX_CONFIG_SUPPORTS_THREADING
@@ -18,11 +17,15 @@
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_PS4 \
- || BX_PLATFORM_RPI
+ || BX_PLATFORM_RPI \
+ || BX_PLATFORM_NX
# include <pthread.h>
#elif BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_WINRT \
|| BX_PLATFORM_XBOXONE
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif // WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <errno.h>
#endif // BX_PLATFORM_
@@ -56,12 +59,12 @@ namespace bx
{
uint32_t* futex = (uint32_t*)m_internal;
- if (State::Unlocked == bx::atomicCompareAndSwap<uint32_t>(futex, State::Unlocked, State::Locked) )
+ if (State::Unlocked == atomicCompareAndSwap<uint32_t>(futex, State::Unlocked, State::Locked) )
{
return;
}
- while (State::Unlocked != bx::atomicCompareAndSwap<uint32_t>(futex, State::Locked, State::Contested) )
+ while (State::Unlocked != atomicCompareAndSwap<uint32_t>(futex, State::Locked, State::Contested) )
{
crt0::futexWait(futex, State::Contested);
}
@@ -71,7 +74,7 @@ namespace bx
{
uint32_t* futex = (uint32_t*)m_internal;
- if (State::Contested == bx::atomicCompareAndSwap<uint32_t>(futex, State::Locked, State::Unlocked) )
+ if (State::Contested == atomicCompareAndSwap<uint32_t>(futex, State::Locked, State::Unlocked) )
{
crt0::futexWake(futex, State::Locked);
}