aboutsummaryrefslogtreecommitdiffstats
path: root/alc/context.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-12-30 20:56:37 -0800
committerChris Robinson <[email protected]>2022-12-30 20:56:37 -0800
commitbeaffdda716e2063d1112cb09956d44d948f40b5 (patch)
tree1aee3242e17c5f59030e4cf26a617e4791ba3ac2 /alc/context.h
parent98ba092c9126ae5534b509a602bfe020d9cebca9 (diff)
Use a simple spinlock to protect the current global context
This will be much for efficient than a recursive mutex, given the amount of contention will be very low.
Diffstat (limited to 'alc/context.h')
-rw-r--r--alc/context.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/alc/context.h b/alc/context.h
index 58a70184..d93d63d6 100644
--- a/alc/context.h
+++ b/alc/context.h
@@ -148,6 +148,7 @@ struct ALCcontext : public al::intrusive_ref<ALCcontext>, ContextBase {
void setError(ALenum errorCode, const char *msg, ...);
/* Process-wide current context */
+ static std::atomic<bool> sGlobalContextLock;
static std::atomic<ALCcontext*> sGlobalContext;
private: