diff options
author | Chris Robinson <[email protected]> | 2022-12-30 20:56:37 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-12-30 20:56:37 -0800 |
commit | beaffdda716e2063d1112cb09956d44d948f40b5 (patch) | |
tree | 1aee3242e17c5f59030e4cf26a617e4791ba3ac2 /alc/context.h | |
parent | 98ba092c9126ae5534b509a602bfe020d9cebca9 (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.h | 1 |
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: |