diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-12 01:14:41 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-12 01:14:41 -0400 |
commit | 3f91935c7fdfbdd4ec299c1af3204aac0b990039 (patch) | |
tree | 32a121f6c6260c68814823bc9c10478bf96806c2 | |
parent | 659f3e7718762205cabf078d3b68c72961f267cf (diff) |
comments
-rw-r--r-- | src/wg.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; |