mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
fxm::check_unlocked added
This commit is contained in:
parent
688097faa9
commit
4b6f8d2f62
1 changed files with 8 additions and 1 deletions
|
@ -841,13 +841,20 @@ public:
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unsafe version of check(), can be used in some cases
|
||||||
|
template <typename T>
|
||||||
|
static inline T* check_unlocked()
|
||||||
|
{
|
||||||
|
return static_cast<T*>(g_vec[get_type<T>()].second.get());
|
||||||
|
}
|
||||||
|
|
||||||
// Check whether the object exists
|
// Check whether the object exists
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static inline T* check()
|
static inline T* check()
|
||||||
{
|
{
|
||||||
reader_lock lock(id_manager::g_mutex);
|
reader_lock lock(id_manager::g_mutex);
|
||||||
|
|
||||||
return static_cast<T*>(g_vec[get_type<T>()].second.get());
|
return check_unlocked<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the object (returns nullptr if it doesn't exist)
|
// Get the object (returns nullptr if it doesn't exist)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue