Small callback optimization and unification

This commit is contained in:
momo5502
2025-02-14 08:58:27 +01:00
parent 6b4e86073e
commit 3218e26306
11 changed files with 62 additions and 69 deletions

View File

@@ -201,7 +201,7 @@ handle process_context::create_thread(memory_manager& memory, const uint64_t sta
const uint64_t stack_size)
{
emulator_thread t{memory, *this, start_address, argument, stack_size, ++this->spawned_thread_count};
auto h = this->threads.store(std::move(t));
on_create_thread(h, *this->threads.get(h));
auto [h, thr] = this->threads.store_and_get(std::move(t));
this->callbacks_->on_create_thread(h, *thr);
return h;
}