mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-26 15:53:35 +01:00
Use std::unordered_multimaps in a few places.
This commit is contained in:
1 parent
67a7205bdd
commit
9d86d3ca9b
4 files changed
+91
-24
No files matched your search
@@ -17,6 +17,15 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#ifdef IOS
|
||||
#include <tr1/unordered_map>
|
||||
namespace std {
|
||||
using std::tr1::unordered_map;
|
||||
using std::tr1::unordered_multimap;
|
||||
}
|
||||
#else
|
||||
#include <unordered_map>
|
||||
#endif
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
@@ -155,7 +164,7 @@ struct LwMutex : public KernelObject
|
||||
static int mutexWaitTimer = -1;
|
||||
static int lwMutexWaitTimer = -1;
|
||||
// Thread -> Mutex locks for thread end.
|
||||
typedef std::multimap<SceUID, SceUID> MutexMap;
|
||||
typedef std::unordered_multimap<SceUID, SceUID> MutexMap;
|
||||
static MutexMap mutexHeldLocks;
|
||||
|
||||
void __KernelMutexBeginCallback(SceUID threadID, SceUID prevCallbackId);
|
||||
@@ -204,7 +213,7 @@ void __KernelMutexShutdown()
|
||||
void __KernelMutexAcquireLock(Mutex *mutex, int count, SceUID thread)
|
||||
{
|
||||
#if defined(_DEBUG)
|
||||
std::pair<MutexMap::iterator, MutexMap::iterator> locked = mutexHeldLocks.equal_range(thread);
|
||||
auto locked = mutexHeldLocks.equal_range(thread);
|
||||
for (MutexMap::iterator iter = locked.first; iter != locked.second; ++iter)
|
||||
_dbg_assert_msg_(SCEKERNEL, (*iter).second != mutex->GetUID(), "Thread %d / mutex %d wasn't removed from mutexHeldLocks properly.", thread, mutex->GetUID());
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user