mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 17:58:37 +12:00
id_traits, idm::get_last_id() added
id_traits for file/dir descriptors idm::get_current_id() removed, thread-local last ID
This commit is contained in:
parent
d9403c2ed2
commit
c2897cddd6
15 changed files with 166 additions and 165 deletions
|
@ -5,16 +5,18 @@ namespace idm
|
|||
{
|
||||
std::mutex g_id_mutex;
|
||||
|
||||
std::unordered_map<u32, ID_data_t> g_id_map;
|
||||
std::unordered_map<u32, id_data_t> g_id_map;
|
||||
|
||||
u32 g_cur_id = 1;
|
||||
thread_local u32 g_tls_last_id = 0xdeadbeef;
|
||||
|
||||
u32 g_last_raw_id = 0;
|
||||
|
||||
void clear()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(g_id_mutex);
|
||||
|
||||
g_id_map.clear();
|
||||
g_cur_id = 1; // first ID
|
||||
g_last_raw_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue