diff options
author | Subv <subv2112@gmail.com> | 2014-12-04 21:03:39 +0100 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2014-12-13 19:40:13 +0100 |
commit | 61434651d82b8ecfe7ed43b72841dfb7325e4ef4 (patch) | |
tree | 344f986813b162cd3500997d75dd50bd6b312312 /src/core/hle/kernel/semaphore.cpp | |
parent | Semaphore: Implemented the initial_count parameter. (diff) | |
download | yuzu-61434651d82b8ecfe7ed43b72841dfb7325e4ef4.tar yuzu-61434651d82b8ecfe7ed43b72841dfb7325e4ef4.tar.gz yuzu-61434651d82b8ecfe7ed43b72841dfb7325e4ef4.tar.bz2 yuzu-61434651d82b8ecfe7ed43b72841dfb7325e4ef4.tar.lz yuzu-61434651d82b8ecfe7ed43b72841dfb7325e4ef4.tar.xz yuzu-61434651d82b8ecfe7ed43b72841dfb7325e4ef4.tar.zst yuzu-61434651d82b8ecfe7ed43b72841dfb7325e4ef4.zip |
Diffstat (limited to 'src/core/hle/kernel/semaphore.cpp')
-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: /** * Creates a semaphore - * @param handle Reference to handle for the newly created semaphore * @param initial_count number of slots reserved for other threads * @param max_count maximum number of holders the semaphore can have * @param name Optional name of semaphore - * @return Pointer to new Semaphore object + * @return Handle for the newly created semaphore */ -Semaphore* CreateSemaphore(Handle& handle, u32 initial_count, +Handle CreateSemaphore(u32 initial_count, u32 max_count, const std::string& name) { Semaphore* semaphore = new Semaphore; - handle = g_object_pool.Create(semaphore); + Handle handle = g_object_pool.Create(semaphore); semaphore->initial_count = initial_count; // When the semaphore is created, some slots are reserved for other threads, @@ -76,7 +75,7 @@ Semaphore* CreateSemaphore(Handle& handle, u32 initial_count, semaphore->current_usage -= initial_count; semaphore->name = name; - return semaphore; + return handle; } ResultCode CreateSemaphore(Handle* handle, u32 initial_count, @@ -85,7 +84,7 @@ ResultCode CreateSemaphore(Handle* handle, u32 initial_count, if (initial_count > max_count) return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::Kernel, ErrorSummary::WrongArgument, ErrorLevel::Permanent); - Semaphore* semaphore = CreateSemaphore(*handle, initial_count, max_count, name); + *handle = CreateSemaphore(initial_count, max_count, name); return RESULT_SUCCESS; } |