]> Cypherpunks repositories - gostls13.git/commit
runtime: fix program termination when main goroutine calls Goexit
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 15 Apr 2014 15:48:17 +0000 (19:48 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 15 Apr 2014 15:48:17 +0000 (19:48 +0400)
commit55e0f36fb46cd3c5b54c4fb0d8444135c3dff0ac
tree8948bb8a11f43597931f9b5f474e98ae33c048a5
parentd826b2ed98ba7d37bd09addc9df16320e58f9e4e
runtime: fix program termination when main goroutine calls Goexit
Do not consider idle finalizer/bgsweep/timer goroutines as doing something useful.
We can't simply set isbackground for the whole lifetime of the goroutines,
because when finalizer goroutine calls user function, we do want to consider it
as doing something useful.
This is borken due to timers for quite some time.
With background sweep is become even more broken.
Fixes #7784.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/87960044
src/pkg/runtime/crash_test.go
src/pkg/runtime/mgc0.c
src/pkg/runtime/time.goc