mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
Add mutex lock for NP changes
This commit is contained in:
parent
81270f3142
commit
8be2a55ccc
3 changed files with 28 additions and 12 deletions
|
@ -401,6 +401,8 @@ error_code sceNpInit(u32 poolsize, vm::ptr<void> poolptr)
|
|||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
std::lock_guard lock(nph->mutex_status);
|
||||
|
||||
if (nph->is_NP_init)
|
||||
{
|
||||
return SCE_NP_ERROR_ALREADY_INITIALIZED;
|
||||
|
@ -432,6 +434,8 @@ error_code sceNpTerm()
|
|||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
std::lock_guard lock(nph->mutex_status);
|
||||
|
||||
if (!nph->is_NP_init)
|
||||
{
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue