[go: up one dir, main page]

errgroup: propagate panic and Goexit through Wait

Recovered panic values are wrapped and saved in Group.
Goexits are detected by a sentinel value set after the given function
returns normally. Wait propagates the first instance of a panic or
Goexit.

According to the runtime.Goexit after the code will not be executed,
with a bool, if f not call runtime.Goexit, is true,
determine whether to propagate runtime.Goexit.

Fixes golang/go#53757

Change-Id: Ic6426fc014fd1c4368ebaceef5b0d6163770a099
Reviewed-on: https://go-review.googlesource.com/c/sync/+/644575
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Alan Donovan <adonovan@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2 files changed
tree: 9cfc760ef7fc9a0883904a0382cca1d16b4ae488
  1. errgroup/
  2. semaphore/
  3. singleflight/
  4. syncmap/
  5. codereview.cfg
  6. CONTRIBUTING.md
  7. go.mod
  8. LICENSE
  9. PATENTS
  10. README.md
README.md

Go Sync

Go Reference

This repository provides Go concurrency primitives in addition to the ones provided by the language and “sync” and “sync/atomic” packages.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/sync.

The main issue tracker for the sync repository is located at https://go.dev/issues. Prefix your issue with “x/sync:” in the subject line, so it is easy to find.