From dff9146600b471d421d1c857978a8b8a372393d3 Mon Sep 17 00:00:00 2001 From: bernhard-gatzhammer Date: Wed, 4 Nov 2015 14:37:24 +0100 Subject: [PATCH] Corrected doxygen style. EMBB-453 --- base_c/include/embb/base/c/mutex.h | 49 ++++++++++++++++++++++++++++++++----------------- base_cpp/include/embb/base/mutex.h | 44 ++++++++++++++++++++++++++------------------ 2 files changed, 58 insertions(+), 35 deletions(-) diff --git a/base_c/include/embb/base/c/mutex.h b/base_c/include/embb/base/c/mutex.h index 6dae96d..863a76f 100644 --- a/base_c/include/embb/base/c/mutex.h +++ b/base_c/include/embb/base/c/mutex.h @@ -162,7 +162,6 @@ typedef opaque_type embb_shared_mutex_t; * \pre \c shared_mutex is uninitialized * \post \c shared_mutex is initialized * - * \param shared_mutex Pointer to shared mutex * \return EMBB_SUCCESS if shared mutex could be initialized \n * EMBB_ERROR otherwise * @@ -172,7 +171,10 @@ typedef opaque_type embb_shared_mutex_t; * * \see embb_shared_mutex_destroy() */ -int embb_shared_mutex_init(embb_shared_mutex_t* shared_mutex); +int embb_shared_mutex_init( + embb_shared_mutex_t* shared_mutex + /**< [IN/OUT] Pointer to shared mutex to be initialized */ + ); /** * Waits until the shared mutex can be locked for writing and locks it. @@ -180,7 +182,6 @@ int embb_shared_mutex_init(embb_shared_mutex_t* shared_mutex); * \pre \c shared_mutex is initialized and not locked by the current thread. * \post If successful, \c shared_mutex is locked for writing. * - * \param shared_mutex Pointer to shared mutex * \return EMBB_SUCCESS if shared_mutex could be locked for writing \n * EMBB_ERROR otherwise * @@ -188,7 +189,10 @@ int embb_shared_mutex_init(embb_shared_mutex_t* shared_mutex); * * \see embb_shared_mutex_try_lock(), embb_shared_mutex_unlock() */ -int embb_shared_mutex_lock(embb_shared_mutex_t* shared_mutex); +int embb_shared_mutex_lock( + embb_shared_mutex_t* shared_mutex + /**< [IN/OUT] Pointer to shared mutex to be locked */ + ); /** * Tries to lock the shared mutex for writing and returns immediately. @@ -199,7 +203,6 @@ int embb_shared_mutex_lock(embb_shared_mutex_t* shared_mutex); * \pre \c shared_mutex is initialized * \post If successful, \c shared_mutex is locked for writing * - * \param shared_mutex Pointer to shared mutex * \return EMBB_SUCCESS if shared_mutex could be locked for writing \n * EMBB_BUSY if shared_mutex could not be locked for writing, because * the mutex is locked for writing or reading \n @@ -209,7 +212,10 @@ int embb_shared_mutex_lock(embb_shared_mutex_t* shared_mutex); * * \see embb_shared_mutex_lock(), embb_shared_mutex_unlock() */ -int embb_shared_mutex_try_lock(embb_shared_mutex_t* shared_mutex); +int embb_shared_mutex_try_lock( + embb_shared_mutex_t* shared_mutex + /**< [IN/OUT] Pointer to shared mutex to be tried to lock */ + ); /** * Unlocks the shared mutex locked for writing. @@ -217,7 +223,6 @@ int embb_shared_mutex_try_lock(embb_shared_mutex_t* shared_mutex); * \pre \c shared_mutex has been locked for writing by the current thread. * \post If successful, \c shared_mutex is unlocked. * - * \param shared_mutex Pointer to shared mutex * \return EMBB_SUCCESS if the operation was successful \n * EMBB_ERROR otherwise * @@ -225,7 +230,10 @@ int embb_shared_mutex_try_lock(embb_shared_mutex_t* shared_mutex); * * \see embb_shared_mutex_lock(), embb_shared_mutex_try_lock() */ -int embb_shared_mutex_unlock(embb_shared_mutex_t* shared_mutex); +int embb_shared_mutex_unlock( + embb_shared_mutex_t* shared_mutex + /**< [IN/OUT] Pointer to shared mutex to be unlocked */ + ); /** * Waits until the shared mutex can be locked for reading and locks it. @@ -233,7 +241,6 @@ int embb_shared_mutex_unlock(embb_shared_mutex_t* shared_mutex); * \pre \c shared_mutex is initialized and not locked by the current thread. * \post If successful, \c shared_mutex is locked for reading. * - * \param shared_mutex Pointer to shared mutex * \return EMBB_SUCCESS if shared_mutex could be locked for reading \n * EMBB_ERROR otherwise * @@ -241,7 +248,10 @@ int embb_shared_mutex_unlock(embb_shared_mutex_t* shared_mutex); * * \see embb_shared_mutex_try_lock_shared(), embb_shared_mutex_unlock_shared() */ -int embb_shared_mutex_lock_shared(embb_shared_mutex_t* shared_mutex); +int embb_shared_mutex_lock_shared( + embb_shared_mutex_t* shared_mutex + /**< [IN/OUT] Pointer to shared mutex to be locked shared */ + ); /** * Tries to lock the shared mutex for reading and returns immediately. @@ -249,7 +259,6 @@ int embb_shared_mutex_lock_shared(embb_shared_mutex_t* shared_mutex); * \pre \c shared_mutex is initialized * \post If successful, \c shared_mutex is locked for reading * - * \param shared_mutex Pointer to shared mutex * \return EMBB_SUCCESS if shared_mutex could be locked for reading \n * EMBB_BUSY if shared_mutex could not be locked for reading \n * EMBB_ERROR if an error occurred @@ -258,7 +267,10 @@ int embb_shared_mutex_lock_shared(embb_shared_mutex_t* shared_mutex); * * \see embb_shared_mutex_lock_shared(), embb_shared_mutex_unlock_shared() */ -int embb_shared_mutex_try_lock_shared(embb_shared_mutex_t* shared_mutex); +int embb_shared_mutex_try_lock_shared( + embb_shared_mutex_t* shared_mutex + /**< [IN/OUT] Pointer to shared mutex to be tried to lock shared */ + ); /** * Unlocks the shared mutex locked for reading. @@ -266,7 +278,6 @@ int embb_shared_mutex_try_lock_shared(embb_shared_mutex_t* shared_mutex); * \pre \c shared_mutex has been locked for reading by the current thread. * \post If successful, \c shared_mutex is unlocked. * - * \param shared_mutex Pointer to shared mutex * \return EMBB_SUCCESS if the operation was successful \n * EMBB_ERROR otherwise * @@ -274,7 +285,10 @@ int embb_shared_mutex_try_lock_shared(embb_shared_mutex_t* shared_mutex); * * \see embb_shared_mutex_lock_shared(), embb_shared_mutex_try_lock_shared() */ -int embb_shared_mutex_unlock_shared(embb_shared_mutex_t* shared_mutex); +int embb_shared_mutex_unlock_shared( + embb_shared_mutex_t* shared_mutex + /**< [IN/OUT] Pointer to shared mutex to be unlocked shared */ + ); /** * Destroys the shared mutex and frees its resources. @@ -282,13 +296,14 @@ int embb_shared_mutex_unlock_shared(embb_shared_mutex_t* shared_mutex); * \pre \c shared_mutex has been initialized * \post \c shared_mutex is uninitialized * - * \param shared_mutex Pointer to shared mutex - * * \notthreadsafe * * \see embb_shared_mutex_init() */ -void embb_shared_mutex_destroy(embb_shared_mutex_t* shared_mutex); +void embb_shared_mutex_destroy( + embb_shared_mutex_t* shared_mutex + /**< [IN/OUT] Pointer to shared mutex to be destroyed */ + ); #ifdef __cplusplus diff --git a/base_cpp/include/embb/base/mutex.h b/base_cpp/include/embb/base/mutex.h index 0ec0f2a..5f35640 100644 --- a/base_cpp/include/embb/base/mutex.h +++ b/base_cpp/include/embb/base/mutex.h @@ -631,21 +631,24 @@ class SharedLock { * * \pre \c shared_mutex is unlocked * \post \c shared_mutex is locked for reading - * - * \param[IN] shared_mutex Shared mutex to be managed */ - explicit SharedLock(SharedMutex& shared_mutex); + explicit SharedLock( + SharedMutex& shared_mutex + /**< [IN] Shared mutex to be managed */ + ); /** * Creates a lock from an unlocked shared mutex without locking it. * * \pre \c shared_mutex is unlocked * \post \c shared_mutex is unlocked - * - * \param[IN] shared_mutex Shared mutex to be managed - * \param[IN] tag Tag to select correct constructor */ - SharedLock(SharedMutex& shared_mutex, DeferLockTag tag); + SharedLock( + SharedMutex& shared_mutex, + /**< [IN] Shared mutex to be managed */ + DeferLockTag tag + /**< [IN] Tag to select correct constructor */ + ); /** * Creates a lock from an unlocked shared mutex and tries to lock it @@ -653,22 +656,26 @@ class SharedLock { * * \pre \c shared_mutex is unlocked * \post If successful, \c shared_mutex is locked for reading - * - * \param[IN] shared_mutex Shared mutex to be managed - * \param[IN] tag Tag to select correct constructor */ - SharedLock(SharedMutex& shared_mutex, TryLockTag tag); + SharedLock( + SharedMutex& shared_mutex, + /**< [IN] Shared mutex to be managed */ + TryLockTag tag + /**< [IN] Tag to select correct constructor */ + ); /** * Creates a lock from an already locked shared mutex. * * \pre \c shared_mutex is locked for reading * \post \c shared_mutex is locked for reading - * - * \param[IN] shared_mutex Shared mutex to be managed - * \param[IN] tag Tag to select correct constructor */ - SharedLock(SharedMutex& shared_mutex, AdoptLockTag tag); + SharedLock( + SharedMutex& shared_mutex, + /**< [IN] Shared mutex to be managed */ + AdoptLockTag tag + /**< [IN] Tag to select correct constructor */ + ); /** * Unlocks the shared mutex if owned. @@ -705,10 +712,11 @@ class SharedLock { /** * Exchange shared mutex ownership with another shared lock - * - * \param other Shared lock to exchange ownership with */ - void Swap(SharedLock& other); + void Swap( + SharedLock& other + /**< [IN/OUT] Shared lock to exchange ownership with */ + ); /** * Gives up ownership of the shared mutex and returns a pointer to it. -- libgit2 0.26.0