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:
Nekotekina 2018-09-03 22:28:33 +03:00
parent 5e556a87ff
commit ca5158a03e
50 changed files with 283 additions and 382 deletions

View file

@ -320,7 +320,7 @@ void audio_config::on_task()
// send aftermix event (normal audio event)
semaphore_lock lock(mutex);
std::lock_guard lock(mutex);
for (u64 key : keys)
{
@ -748,7 +748,7 @@ error_code cellAudioSetNotifyEventQueue(u64 key)
return CELL_AUDIO_ERROR_NOT_INIT;
}
semaphore_lock lock(g_audio->mutex);
std::lock_guard lock(g_audio->mutex);
for (auto k : g_audio->keys) // check for duplicates
{
@ -783,7 +783,7 @@ error_code cellAudioRemoveNotifyEventQueue(u64 key)
return CELL_AUDIO_ERROR_NOT_INIT;
}
semaphore_lock lock(g_audio->mutex);
std::lock_guard lock(g_audio->mutex);
for (auto i = g_audio->keys.begin(); i != g_audio->keys.end(); i++)
{