From e780b86c9f5fec4a877ccfbaa7d62a56bc8f9580 Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Mon, 18 Mar 2024 18:35:56 -0700 Subject: [PATCH] Update docs on how activation works in Group. --- taskgroup.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/taskgroup.go b/taskgroup.go index 236484b..bbb5d8a 100644 --- a/taskgroup.go +++ b/taskgroup.go @@ -27,6 +27,9 @@ type Group struct { // active is nonzero when the group is "active", meaning there has been at // least one call to Go since the group was created or the last Wait. + // + // Together active and μ work as a kind of resettable sync.Once; the fast + // path reads active and only acquires μ if it discovers setup is needed. active atomic.Uint32 μ sync.Mutex // guards err