mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Cleanup semaphore<> (sema.h) and mutex.h (shared_mutex)
Remove semaphore_lock and writer_lock classes, replace with std::lock_guard Change semaphore<> interface to Lockable (+ exotic try_unlock method)
This commit is contained in:
parent
5e556a87ff
commit
ca5158a03e
50 changed files with 283 additions and 382 deletions
|
|
@ -22,7 +22,7 @@ struct sysutil_cb_manager
|
|||
|
||||
std::function<s32(ppu_thread&)> get_cb()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
std::lock_guard lock(mutex);
|
||||
|
||||
if (registered.empty())
|
||||
{
|
||||
|
|
@ -41,7 +41,7 @@ extern void sysutil_register_cb(std::function<s32(ppu_thread&)>&& cb)
|
|||
{
|
||||
const auto cbm = fxm::get_always<sysutil_cb_manager>();
|
||||
|
||||
std::lock_guard<std::mutex> lock(cbm->mutex);
|
||||
std::lock_guard lock(cbm->mutex);
|
||||
|
||||
cbm->registered.push(std::move(cb));
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ extern void sysutil_send_system_cmd(u64 status, u64 param)
|
|||
{
|
||||
if (cb.first)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(cbm->mutex);
|
||||
std::lock_guard lock(cbm->mutex);
|
||||
|
||||
cbm->registered.push([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue