mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00: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;
|
||||
}
|
||||
|
||||
// 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
|
||||
template <typename T>
|
||||
static inline T* check()
|
||||
{
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue