mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-23 03:06:52 -04:00
strat: avoid using unique_lock in a few places
This commit is contained in:
parent
6a2ee02409
commit
b4122da6ad
2 changed files with 9 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue