strat: avoid using unique_lock in a few places

This commit is contained in:
Michael Scire 2021-01-12 03:54:46 -08:00
parent 6a2ee02409
commit b4122da6ad
2 changed files with 9 additions and 9 deletions

View file

@ -55,14 +55,14 @@ namespace ams::os::impl {
manager.NotifyThreadNameChanged(thread);
{
std::unique_lock lk(GetReference(thread->cs_thread));
GetReference(thread->cs_thread).Lock();
while (thread->state == ThreadType::State_Initialized) {
GetReference(thread->cv_thread).Wait(GetPointer(thread->cs_thread));
}
const auto new_state = thread->state;
GetReference(thread->cs_thread).Unlock();
if (thread->state == ThreadType::State_Started) {
lk.unlock();
if (new_state == ThreadType::State_Started) {
thread->function(thread->argument);
}
}