mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Alias MutexAutoLock to the simpler std::lock_guard
This commit is contained in:
parent
99b6315c1a
commit
244f4f285a
3 changed files with 12 additions and 7 deletions
|
@ -117,7 +117,7 @@ bool Thread::start()
|
|||
|
||||
// The mutex may already be locked if the thread is being restarted
|
||||
// FIXME: what if this fails, or if already locked by same thread?
|
||||
MutexAutoLock sf_lock(m_start_finished_mutex, std::try_to_lock);
|
||||
std::unique_lock sf_lock(m_start_finished_mutex, std::try_to_lock);
|
||||
|
||||
try {
|
||||
m_thread_obj = new std::thread(threadProc, this);
|
||||
|
@ -189,7 +189,7 @@ void Thread::threadProc(Thread *thr)
|
|||
|
||||
// Wait for the thread that started this one to finish initializing the
|
||||
// thread handle so that getThreadId/getThreadHandle will work.
|
||||
MutexAutoLock sf_lock(thr->m_start_finished_mutex);
|
||||
std::unique_lock sf_lock(thr->m_start_finished_mutex);
|
||||
|
||||
thr->m_retval = thr->run();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue