2015-08-05 17:30:32 +02:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "IdManager.h"
|
|
|
|
|
|
|
|
|
|
namespace idm
|
|
|
|
|
{
|
|
|
|
|
std::mutex g_id_mutex;
|
|
|
|
|
|
2015-08-11 18:14:53 +02:00
|
|
|
std::unordered_map<u32, id_data_t> g_id_map;
|
2015-08-05 17:30:32 +02:00
|
|
|
|
2015-08-11 18:14:53 +02:00
|
|
|
thread_local u32 g_tls_last_id = 0xdeadbeef;
|
|
|
|
|
|
|
|
|
|
u32 g_last_raw_id = 0;
|
2015-08-05 17:30:32 +02:00
|
|
|
|
|
|
|
|
void clear()
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(g_id_mutex);
|
|
|
|
|
|
|
|
|
|
g_id_map.clear();
|
2015-08-11 18:14:53 +02:00
|
|
|
g_last_raw_id = 0;
|
2015-08-05 17:30:32 +02:00
|
|
|
}
|
|
|
|
|
}
|
2015-08-06 15:05:33 +02:00
|
|
|
|
|
|
|
|
namespace fxm
|
|
|
|
|
{
|
|
|
|
|
std::mutex g_fx_mutex;
|
|
|
|
|
|
|
|
|
|
std::unordered_map<std::type_index, std::shared_ptr<void>> g_fx_map;
|
|
|
|
|
|
|
|
|
|
void clear()
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(g_fx_mutex);
|
|
|
|
|
|
|
|
|
|
g_fx_map.clear();
|
|
|
|
|
}
|
|
|
|
|
}
|