diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-11-14 21:20:43 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-11-14 21:20:43 -0500 |
commit | 8fe33a340b8979a73fa84f201c15519a9b5d0266 (patch) | |
tree | 12cdbb1c1b9a48f533ab36980602785be1e1deeb /libdimension/progress.c | |
parent | 20a55aa78050d94b187d4edfaac91ea00efea505 (diff) | |
download | dimension-8fe33a340b8979a73fa84f201c15519a9b5d0266.tar.xz |
Document libdimension with Doxygen.
Diffstat (limited to 'libdimension/progress.c')
-rw-r--r-- | libdimension/progress.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libdimension/progress.c b/libdimension/progress.c index 51e7992..243b7e6 100644 --- a/libdimension/progress.c +++ b/libdimension/progress.c @@ -18,31 +18,39 @@ * <http://www.gnu.org/licenses/>. * *************************************************************************/ +/** + * @file + * Progress objects. + */ + #include "dimension-impl.h" #include <pthread.h> -/* A single element in an array for dmnsn_progress. Progress of this item is - progress/total. */ +/** A single element in an array for dmnsn_progress. Progress of this item is + \p progress/\p total. */ typedef struct { unsigned int progress, total; } dmnsn_progress_element; -/* For thread synchronization */ - +/** Read-lock a progress object. */ static void dmnsn_progress_rdlock_impl(const dmnsn_progress *progress); +/** Write-lock a progress object. */ static void dmnsn_progress_wrlock_impl(dmnsn_progress *progress); +/** Unlock a progress object. */ static void dmnsn_progress_unlock_impl(void *arg); +/** Read-lock a progress object and ensure that it will unlock upon error. */ #define dmnsn_progress_rdlock(progress) \ dmnsn_progress_rdlock_impl(progress); \ pthread_cleanup_push(&dmnsn_progress_unlock_impl, (void *)progress); +/** Write-lock a progress object and ensure that it will unlock upon error. */ #define dmnsn_progress_wrlock(progress) \ dmnsn_progress_wrlock_impl(progress); \ pthread_cleanup_push(&dmnsn_progress_unlock_impl, (void *)progress); +/** Unlock a progress object. */ #define dmnsn_progress_unlock(progress) \ pthread_cleanup_pop(1); - /* Allocate a new dmnsn_progress* */ dmnsn_progress * dmnsn_new_progress() |