diff options
author | Austin Clements <austin@google.com> | 2016-11-30 10:43:14 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-11-30 17:09:06 +0000 |
commit | 3f0f24df7b0017739b415e75bc4375a1483bd1a1 (patch) | |
tree | 59a6291c140954fe94ee52e3f871e21a4592e6a5 /src/runtime/cgocall.go | |
parent | 2b1abf75945508a602daa29a87b7a45e0b6b04af (diff) | |
download | go-3f0f24df7b0017739b415e75bc4375a1483bd1a1.tar.gz go-3f0f24df7b0017739b415e75bc4375a1483bd1a1.zip |
runtime: use standard comment style in cgocall
Change-Id: I9f2c2da4aa512729ae40562b06601da95ba50d6f
Reviewed-on: https://go-review.googlesource.com/33689
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/cgocall.go')
-rw-r--r-- | src/runtime/cgocall.go | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go index 86091c7a4d..dc4a9a9820 100644 --- a/src/runtime/cgocall.go +++ b/src/runtime/cgocall.go @@ -104,10 +104,8 @@ func cgocall(fn, arg unsafe.Pointer) int32 { racereleasemerge(unsafe.Pointer(&racecgosync)) } - /* - * Lock g to m to ensure we stay on the same stack if we do a - * cgo callback. In case of panic, unwindm calls endcgo. - */ + // Lock g to m to ensure we stay on the same stack if we do a + // cgo callback. In case of panic, unwindm calls endcgo. lockOSThread() mp := getg().m mp.ncgocall++ @@ -116,17 +114,15 @@ func cgocall(fn, arg unsafe.Pointer) int32 { // Reset traceback. mp.cgoCallers[0] = 0 - /* - * Announce we are entering a system call - * so that the scheduler knows to create another - * M to run goroutines while we are in the - * foreign code. - * - * The call to asmcgocall is guaranteed not to - * split the stack and does not allocate memory, - * so it is safe to call while "in a system call", outside - * the $GOMAXPROCS accounting. - */ + // Announce we are entering a system call + // so that the scheduler knows to create another + // M to run goroutines while we are in the + // foreign code. + // + // The call to asmcgocall is guaranteed not to + // split the stack and does not allocate memory, + // so it is safe to call while "in a system call", outside + // the $GOMAXPROCS accounting. entersyscall(0) errno := asmcgocall(fn, arg) exitsyscall(0) |