From 8fe33a340b8979a73fa84f201c15519a9b5d0266 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 14 Nov 2010 21:20:43 -0500 Subject: Document libdimension with Doxygen. --- libdimension/threads.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'libdimension/threads.c') diff --git a/libdimension/threads.c b/libdimension/threads.c index 2c00cc8..5e39fdc 100644 --- a/libdimension/threads.c +++ b/libdimension/threads.c @@ -18,15 +18,22 @@ * . * *************************************************************************/ +/** + * @file + * Background threading. + */ + #include "dimension-impl.h" #include +/** The payload to pass to the pthread callback. */ typedef struct dmnsn_thread_payload { dmnsn_thread_fn *thread_fn; void *arg; dmnsn_progress *progress; } dmnsn_thread_payload; +/** Clean up after a thread. */ static void dmnsn_thread_cleanup(void *arg) { @@ -37,6 +44,7 @@ dmnsn_thread_cleanup(void *arg) dmnsn_done_progress(progress); } +/** pthread callback -- call the real thread callback. */ static void * dmnsn_thread(void *arg) { @@ -51,15 +59,15 @@ dmnsn_thread(void *arg) } void -dmnsn_new_thread(dmnsn_progress *progress, const pthread_attr_t *attr, - dmnsn_thread_fn *thread_fn, void *arg) +dmnsn_new_thread(dmnsn_progress *progress, dmnsn_thread_fn *thread_fn, + void *arg) { dmnsn_thread_payload *payload = dmnsn_malloc(sizeof(dmnsn_thread_payload)); payload->thread_fn = thread_fn; payload->arg = arg; payload->progress = progress; - if (pthread_create(&progress->thread, attr, &dmnsn_thread, payload) != 0) { + if (pthread_create(&progress->thread, NULL, &dmnsn_thread, payload) != 0) { dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't start thread."); } } -- cgit v1.2.3