summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wg.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wg.h b/src/wg.h
index b2eb4c4..63859be 100644
--- a/src/wg.h
+++ b/src/wg.h
@@ -22,7 +22,12 @@
#include <pthread.h>
/* When you call wg_wait, the waitgroup is destroyed. You must
- * re-wg_init it if you want to reuse it. */
+ * re-wg_init it if you want to reuse it.
+ *
+ * Call wg_add() right before you call pthread_create, and call
+ * wg_sub() right before your thread exits. In your master process,
+ * call wg_wait() to wait for all threads to finish.
+ */
struct wg {
int count;