mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-22 11:35:46 +00:00
Kernel: Start using boost::intrusive_ptr for lifetime management
This commit is contained in:
parent
d751de7341
commit
8ad41775cc
13 changed files with 96 additions and 91 deletions
|
@ -70,7 +70,7 @@ ResultCode CreateSemaphore(Handle* handle, s32 initial_count,
|
|||
}
|
||||
|
||||
ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count) {
|
||||
Semaphore* semaphore = g_handle_table.Get<Semaphore>(handle);
|
||||
Semaphore* semaphore = g_handle_table.Get<Semaphore>(handle).get();
|
||||
if (semaphore == nullptr)
|
||||
return InvalidHandle(ErrorModule::Kernel);
|
||||
|
||||
|
@ -84,7 +84,7 @@ ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count) {
|
|||
// Notify some of the threads that the semaphore has been released
|
||||
// stop once the semaphore is full again or there are no more waiting threads
|
||||
while (!semaphore->waiting_threads.empty() && semaphore->IsAvailable()) {
|
||||
Thread* thread = Kernel::g_handle_table.Get<Thread>(semaphore->waiting_threads.front());
|
||||
Thread* thread = Kernel::g_handle_table.Get<Thread>(semaphore->waiting_threads.front()).get();
|
||||
if (thread != nullptr)
|
||||
thread->ResumeFromWait();
|
||||
semaphore->waiting_threads.pop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue