Core: Make use of C++17 deduction guides with locks
C++17 allows omitting the mutex type, which makes for both less reading and more flexibility (e.g. The mutex type can change and all occurrences don't need to be updated).
This commit is contained in:
1 parent
41316daf91
commit
a8b0661fb0
23 files changed
+98
-98
No files matched your search
@@ -141,7 +141,7 @@ void Init()
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(s_ts_write_lock);
|
||||
std::lock_guard lk(s_ts_write_lock);
|
||||
MoveEvents();
|
||||
ClearPendingEvents();
|
||||
UnregisterAllEvents();
|
||||
@@ -149,7 +149,7 @@ void Shutdown()
|
||||
|
||||
void DoState(PointerWrap& p)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(s_ts_write_lock);
|
||||
std::lock_guard lk(s_ts_write_lock);
|
||||
p.Do(g.slice_length);
|
||||
p.Do(g.global_timer);
|
||||
p.Do(s_idled_cycles);
|
||||
@@ -265,7 +265,7 @@ void ScheduleEvent(s64 cycles_into_future, EventType* event_type, u64 userdata,
|
||||
*event_type->name);
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lk(s_ts_write_lock);
|
||||
std::lock_guard lk(s_ts_write_lock);
|
||||
s_ts_queue.Push(Event{g.global_timer + cycles_into_future, 0, userdata, event_type});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user