Skip to content

Commit 3f0f24d

Browse files
committed
runtime: use standard comment style in cgocall
Change-Id: I9f2c2da4aa512729ae40562b06601da95ba50d6f Reviewed-on: https://go-review.googlesource.com/33689 Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent 2b1abf7 commit 3f0f24d

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

src/runtime/cgocall.go

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,8 @@ func cgocall(fn, arg unsafe.Pointer) int32 {
104104
racereleasemerge(unsafe.Pointer(&racecgosync))
105105
}
106106

107-
/*
108-
* Lock g to m to ensure we stay on the same stack if we do a
109-
* cgo callback. In case of panic, unwindm calls endcgo.
110-
*/
107+
// Lock g to m to ensure we stay on the same stack if we do a
108+
// cgo callback. In case of panic, unwindm calls endcgo.
111109
lockOSThread()
112110
mp := getg().m
113111
mp.ncgocall++
@@ -116,17 +114,15 @@ func cgocall(fn, arg unsafe.Pointer) int32 {
116114
// Reset traceback.
117115
mp.cgoCallers[0] = 0
118116

119-
/*
120-
* Announce we are entering a system call
121-
* so that the scheduler knows to create another
122-
* M to run goroutines while we are in the
123-
* foreign code.
124-
*
125-
* The call to asmcgocall is guaranteed not to
126-
* split the stack and does not allocate memory,
127-
* so it is safe to call while "in a system call", outside
128-
* the $GOMAXPROCS accounting.
129-
*/
117+
// Announce we are entering a system call
118+
// so that the scheduler knows to create another
119+
// M to run goroutines while we are in the
120+
// foreign code.
121+
//
122+
// The call to asmcgocall is guaranteed not to
123+
// split the stack and does not allocate memory,
124+
// so it is safe to call while "in a system call", outside
125+
// the $GOMAXPROCS accounting.
130126
entersyscall(0)
131127
errno := asmcgocall(fn, arg)
132128
exitsyscall(0)

0 commit comments

Comments
 (0)