]> Cypherpunks repositories - gostls13.git/commit
sync/once: panicking functions still marked as complete
authorRob Pike <r@golang.org>
Tue, 16 Sep 2014 21:00:01 +0000 (14:00 -0700)
committerRob Pike <r@golang.org>
Tue, 16 Sep 2014 21:00:01 +0000 (14:00 -0700)
commitb22dc6385d66ac2e74afb9a5d503394fc7273d81
treeadf5a2640763ee02c76dfdbcff2349a4ac7a77ae
parent15274e5c9bd5393f67a77200f0669ab00f2ab0ed
sync/once: panicking functions still marked as complete

This is a corner case, and one that was even tested, but this
CL changes the behavior to say that f is "complete" even if it panics.
But don't think of it that way, think of it as sync.Once runs
the function only the first time it is called, rather than
repeatedly until a run of the function completes.

Fixes #8118.

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews
https://golang.org/cl/137350043
src/sync/once.go
src/sync/once_test.go