summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-04-12 01:14:41 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-04-12 01:14:41 -0400
commit3f91935c7fdfbdd4ec299c1af3204aac0b990039 (patch)
tree32a121f6c6260c68814823bc9c10478bf96806c2
parent659f3e7718762205cabf078d3b68c72961f267cf (diff)
comments
-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;