From 3f91935c7fdfbdd4ec299c1af3204aac0b990039 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 12 Apr 2016 01:14:41 -0400 Subject: comments --- src/wg.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 /* 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; -- cgit v1.2.3-54-g00ecf