diff options
author | Chris Robinson <[email protected]> | 2018-11-26 20:34:16 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-26 20:34:16 -0800 |
commit | bf9db1fe3d611137448c0eb99978c8906531ffc1 (patch) | |
tree | 8b63692a566aed2922b56126106c4e68412a0c79 /common/uintmap.h | |
parent | ecab90802a62266687cf8aeaa61dc2811ce191e7 (diff) |
Remove althrd_t from Windows
Diffstat (limited to 'common/uintmap.h')
-rw-r--r-- | common/uintmap.h | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/common/uintmap.h b/common/uintmap.h deleted file mode 100644 index 0646d2b5..00000000 --- a/common/uintmap.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef AL_UINTMAP_H -#define AL_UINTMAP_H - -#include <unordered_map> -#include <mutex> - -#include "AL/al.h" - -template<typename T0, typename T1> -class ThrSafeMap { - std::unordered_map<T0, T1> mValues; - std::mutex mLock; - -public: - void InsertEntry(T0 key, T1 value) noexcept - { - std::lock_guard<std::mutex> _{mLock}; - mValues[key] = value; - } - - T1 RemoveKey(T0 key) noexcept - { - T1 retval{}; - - std::lock_guard<std::mutex> _{mLock}; - auto iter = mValues.find(key); - if(iter != mValues.end()) - retval = iter->second; - mValues.erase(iter); - - return retval; - } -}; - -#endif /* AL_UINTMAP_H */ |