aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/os/proc.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-10-31 00:59:47 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-10-31 00:59:47 +0000
commitaf146490bb04205107cb23e301ec7a8ff927b5fc (patch)
tree13beeaed3698c61903fe93fb1ce70bd9b18d4e7f /libgo/go/os/proc.go
parent725e1be3406315d9bcc8195d7eef0a7082b3c7cc (diff)
downloadgcc-af146490bb04205107cb23e301ec7a8ff927b5fc.zip
gcc-af146490bb04205107cb23e301ec7a8ff927b5fc.tar.gz
gcc-af146490bb04205107cb23e301ec7a8ff927b5fc.tar.bz2
runtime: Remove now unnecessary pad field from ParFor.
It is not needed due to the removal of the ctx field. Reviewed-on: https://go-review.googlesource.com/16525 From-SVN: r229616
Diffstat (limited to 'libgo/go/os/proc.go')
-rw-r--r--libgo/go/os/proc.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/libgo/go/os/proc.go b/libgo/go/os/proc.go
index 774f099..33a8b26 100644
--- a/libgo/go/os/proc.go
+++ b/libgo/go/os/proc.go
@@ -44,6 +44,14 @@ func Getgroups() ([]int, error) {
// Exit causes the current program to exit with the given status code.
// Conventionally, code zero indicates success, non-zero an error.
-// The program terminates immediately; deferred functions are
-// not run.
-func Exit(code int) { syscall.Exit(code) }
+// The program terminates immediately; deferred functions are not run.
+func Exit(code int) {
+ if code == 0 {
+ // Give race detector a chance to fail the program.
+ // Racy programs do not have the right to finish successfully.
+ runtime_beforeExit()
+ }
+ syscall.Exit(code)
+}
+
+func runtime_beforeExit() // implemented in runtime