diff options
| -rw-r--r-- | src/core/hle/kernel/semaphore.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index c5c1fbeb3..c7afe49fc 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp | |||
| @@ -57,17 +57,16 @@ public: | |||
| 57 | 57 | ||
| 58 | /** | 58 | /** |
| 59 | * Creates a semaphore | 59 | * Creates a semaphore |
| 60 | * @param handle Reference to handle for the newly created semaphore | ||
| 61 | * @param initial_count number of slots reserved for other threads | 60 | * @param initial_count number of slots reserved for other threads |
| 62 | * @param max_count maximum number of holders the semaphore can have | 61 | * @param max_count maximum number of holders the semaphore can have |
| 63 | * @param name Optional name of semaphore | 62 | * @param name Optional name of semaphore |
| 64 | * @return Pointer to new Semaphore object | 63 | * @return Handle for the newly created semaphore |
| 65 | */ | 64 | */ |
| 66 | Semaphore* CreateSemaphore(Handle& handle, u32 initial_count, | 65 | Handle CreateSemaphore(u32 initial_count, |
| 67 | u32 max_count, const std::string& name) { | 66 | u32 max_count, const std::string& name) { |
| 68 | 67 | ||
| 69 | Semaphore* semaphore = new Semaphore; | 68 | Semaphore* semaphore = new Semaphore; |
| 70 | handle = g_object_pool.Create(semaphore); | 69 | Handle handle = g_object_pool.Create(semaphore); |
| 71 | 70 | ||
| 72 | semaphore->initial_count = initial_count; | 71 | semaphore->initial_count = initial_count; |
| 73 | // When the semaphore is created, some slots are reserved for other threads, | 72 | // When the semaphore is created, some slots are reserved for other threads, |
| @@ -76,7 +75,7 @@ Semaphore* CreateSemaphore(Handle& handle, u32 initial_count, | |||
| 76 | semaphore->current_usage -= initial_count; | 75 | semaphore->current_usage -= initial_count; |
| 77 | semaphore->name = name; | 76 | semaphore->name = name; |
| 78 | 77 | ||
| 79 | return semaphore; | 78 | return handle; |
| 80 | } | 79 | } |
| 81 | 80 | ||
| 82 | ResultCode CreateSemaphore(Handle* handle, u32 initial_count, | 81 | ResultCode CreateSemaphore(Handle* handle, u32 initial_count, |
| @@ -85,7 +84,7 @@ ResultCode CreateSemaphore(Handle* handle, u32 initial_count, | |||
| 85 | if (initial_count > max_count) | 84 | if (initial_count > max_count) |
| 86 | return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::Kernel, | 85 | return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::Kernel, |
| 87 | ErrorSummary::WrongArgument, ErrorLevel::Permanent); | 86 | ErrorSummary::WrongArgument, ErrorLevel::Permanent); |
| 88 | Semaphore* semaphore = CreateSemaphore(*handle, initial_count, max_count, name); | 87 | *handle = CreateSemaphore(initial_count, max_count, name); |
| 89 | 88 | ||
| 90 | return RESULT_SUCCESS; | 89 | return RESULT_SUCCESS; |
| 91 | } | 90 | } |