aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/kernel/semaphore.cpp
diff options
context:
space:
mode:
authorGravatar Subv <subv2112@gmail.com>2014-12-04 15:03:39 -0500
committerGravatar Subv <subv2112@gmail.com>2014-12-13 13:40:13 -0500
commit61434651d82b8ecfe7ed43b72841dfb7325e4ef4 (patch)
tree344f986813b162cd3500997d75dd50bd6b312312 /src/core/hle/kernel/semaphore.cpp
parentabff4a7ee23a04baa9d264417c9c814309ef294b (diff)
Semaphores: Addressed some style issues
Diffstat (limited to 'src/core/hle/kernel/semaphore.cpp')
-rw-r--r--src/core/hle/kernel/semaphore.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp
index c5c1fbeb..c7afe49f 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;
}