mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
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:
@ -1028,7 +1028,7 @@ void QueueHostJob(std::function<void()> job, bool run_during_stop)
|
||||
|
||||
bool send_message = false;
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_jobs_lock);
|
||||
std::lock_guard guard(s_host_jobs_lock);
|
||||
send_message = s_host_jobs_queue.empty();
|
||||
s_host_jobs_queue.emplace(HostJob{std::move(job), run_during_stop});
|
||||
}
|
||||
@ -1042,7 +1042,7 @@ void HostDispatchJobs()
|
||||
// WARNING: This should only run on the Host Thread.
|
||||
// NOTE: This function is potentially re-entrant. If a job calls
|
||||
// Core::Stop for instance then we'll enter this a second time.
|
||||
std::unique_lock<std::mutex> guard(s_host_jobs_lock);
|
||||
std::unique_lock guard(s_host_jobs_lock);
|
||||
while (!s_host_jobs_queue.empty())
|
||||
{
|
||||
HostJob job = std::move(s_host_jobs_queue.front());
|
||||
|
Reference in New Issue
Block a user