LV2_LOCK removed

This commit is contained in:
Nekotekina 2017-02-05 16:35:10 +03:00
parent eebd48e51d
commit bf6854d121
5 changed files with 21 additions and 53 deletions

View file

@ -274,7 +274,7 @@ void audio_config::on_task()
// send aftermix event (normal audio event)
LV2_LOCK;
semaphore_lock lock(mutex);
for (u64 key : keys)
{
@ -702,7 +702,7 @@ s32 cellAudioSetNotifyEventQueue(u64 key)
return CELL_AUDIO_ERROR_NOT_INIT;
}
LV2_LOCK;
semaphore_lock lock(g_audio->mutex);
for (auto k : g_audio->keys) // check for duplicates
{
@ -737,7 +737,7 @@ s32 cellAudioRemoveNotifyEventQueue(u64 key)
return CELL_AUDIO_ERROR_NOT_INIT;
}
LV2_LOCK;
semaphore_lock lock(g_audio->mutex);
for (auto i = g_audio->keys.begin(); i != g_audio->keys.end(); i++)
{

View file

@ -137,6 +137,8 @@ public:
std::vector<u64> keys;
semaphore<> mutex;
audio_config()
{
for (u32 i = 0; i < AUDIO_PORT_COUNT; i++)

View file

@ -1015,5 +1015,3 @@ extern ppu_function_t ppu_get_syscall(u64 code)
return nullptr;
}
DECLARE(lv2_lock_guard::g_sema);

View file

@ -106,27 +106,3 @@ struct lv2_obj
return res;
}
};
// Temporary implementation for LV2_UNLOCK (TODO: remove it)
struct lv2_lock_guard
{
static semaphore<> g_sema;
lv2_lock_guard(const lv2_lock_guard&) = delete;
lv2_lock_guard()
{
g_sema.post();
}
~lv2_lock_guard()
{
g_sema.wait();
}
};
using lv2_lock_t = semaphore_lock&;
#define LV2_LOCK semaphore_lock lv2_lock(lv2_lock_guard::g_sema)
#define LV2_UNLOCK lv2_lock_guard{}

View file

@ -418,20 +418,16 @@ void Emulator::Resume()
SendDbgCommand(DID_RESUME_EMU);
auto on_select = [](u32, cpu_thread& cpu)
{
LV2_LOCK;
cpu.state -= cpu_flag::dbg_global_pause;
cpu.notify();
};
auto on_select = [](u32, cpu_thread& cpu)
{
cpu.state -= cpu_flag::dbg_global_pause;
cpu.notify();
};
idm::select<ppu_thread>(on_select);
idm::select<ARMv7Thread>(on_select);
idm::select<RawSPUThread>(on_select);
idm::select<SPUThread>(on_select);
}
idm::select<ppu_thread>(on_select);
idm::select<ARMv7Thread>(on_select);
idm::select<RawSPUThread>(on_select);
idm::select<SPUThread>(on_select);
rpcs3::on_resume()();
@ -450,20 +446,16 @@ void Emulator::Stop()
rpcs3::on_stop()();
SendDbgCommand(DID_STOP_EMU);
auto on_select = [](u32, cpu_thread& cpu)
{
LV2_LOCK;
cpu.state += cpu_flag::dbg_global_stop;
cpu.get()->set_exception(std::make_exception_ptr(EmulationStopped()));
};
auto on_select = [](u32, cpu_thread& cpu)
{
cpu.state += cpu_flag::dbg_global_stop;
cpu.get()->set_exception(std::make_exception_ptr(EmulationStopped()));
};
idm::select<ppu_thread>(on_select);
idm::select<ARMv7Thread>(on_select);
idm::select<RawSPUThread>(on_select);
idm::select<SPUThread>(on_select);
}
idm::select<ppu_thread>(on_select);
idm::select<ARMv7Thread>(on_select);
idm::select<RawSPUThread>(on_select);
idm::select<SPUThread>(on_select);
LOG_NOTICE(GENERAL, "All threads signaled...");