mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 06:51:26 +12:00
Fixes issues where the mutex is destroyed while an unlock is happening
This commit is contained in:
parent
483ee5e488
commit
7ebd3bbcbf
1 changed files with 3 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "Emu/Memory/vm.h"
|
#include "Emu/Memory/vm.h"
|
||||||
#include "Emu/System.h"
|
#include "Emu/System.h"
|
||||||
#include "Emu/IdManager.h"
|
#include "Emu/IdManager.h"
|
||||||
|
@ -80,6 +80,8 @@ error_code sys_mutex_destroy(u32 mutex_id)
|
||||||
|
|
||||||
const auto mutex = idm::withdraw<lv2_obj, lv2_mutex>(mutex_id, [](lv2_mutex& mutex) -> CellError
|
const auto mutex = idm::withdraw<lv2_obj, lv2_mutex>(mutex_id, [](lv2_mutex& mutex) -> CellError
|
||||||
{
|
{
|
||||||
|
std::lock_guard lock(mutex.mutex);
|
||||||
|
|
||||||
if (mutex.owner || mutex.lock_count)
|
if (mutex.owner || mutex.lock_count)
|
||||||
{
|
{
|
||||||
return CELL_EBUSY;
|
return CELL_EBUSY;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue