Commit 3f0f24df authored by Austin Clements's avatar Austin Clements

runtime: use standard comment style in cgocall

Change-Id: I9f2c2da4aa512729ae40562b06601da95ba50d6f
Reviewed-on: https://go-review.googlesource.com/33689Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 2b1abf75
...@@ -104,10 +104,8 @@ func cgocall(fn, arg unsafe.Pointer) int32 { ...@@ -104,10 +104,8 @@ func cgocall(fn, arg unsafe.Pointer) int32 {
racereleasemerge(unsafe.Pointer(&racecgosync)) racereleasemerge(unsafe.Pointer(&racecgosync))
} }
/* // Lock g to m to ensure we stay on the same stack if we do a
* 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.
* cgo callback. In case of panic, unwindm calls endcgo.
*/
lockOSThread() lockOSThread()
mp := getg().m mp := getg().m
mp.ncgocall++ mp.ncgocall++
...@@ -116,17 +114,15 @@ func cgocall(fn, arg unsafe.Pointer) int32 { ...@@ -116,17 +114,15 @@ func cgocall(fn, arg unsafe.Pointer) int32 {
// Reset traceback. // Reset traceback.
mp.cgoCallers[0] = 0 mp.cgoCallers[0] = 0
/* // Announce we are entering a system call
* Announce we are entering a system call // so that the scheduler knows to create another
* so that the scheduler knows to create another // M to run goroutines while we are in the
* M to run goroutines while we are in the // foreign code.
* foreign code. //
* // The call to asmcgocall is guaranteed not to
* The call to asmcgocall is guaranteed not to // split the stack and does not allocate memory,
* split the stack and does not allocate memory, // so it is safe to call while "in a system call", outside
* so it is safe to call while "in a system call", outside // the $GOMAXPROCS accounting.
* the $GOMAXPROCS accounting.
*/
entersyscall(0) entersyscall(0)
errno := asmcgocall(fn, arg) errno := asmcgocall(fn, arg)
exitsyscall(0) exitsyscall(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment