diff options
Diffstat (limited to 'src')
-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; |