mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator
synced 2025-05-23 21:57:40 +08:00
Add try_get_steam_client().
This allows the emulator to attempt to access the global steam_client object without creating it if it doesn't exist.
This commit is contained in:
parent
cde29f0fd0
commit
75035de2f4
10
dll/dll.cpp
10
dll/dll.cpp
@ -140,6 +140,16 @@ Steam_Client *get_steam_client()
|
||||
return steamclient_instance;
|
||||
}
|
||||
|
||||
Steam_Client *try_get_steam_client()
|
||||
{
|
||||
Steam_Client * ret = NULL;
|
||||
if (global_mutex.try_lock() == true) {
|
||||
ret = steamclient_instance;
|
||||
global_mutex.unlock();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void destroy_client()
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user