@@ -104,10 +104,8 @@ func cgocall(fn, arg unsafe.Pointer) int32 {
104
104
racereleasemerge (unsafe .Pointer (& racecgosync ))
105
105
}
106
106
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.
111
109
lockOSThread ()
112
110
mp := getg ().m
113
111
mp .ncgocall ++
@@ -116,17 +114,15 @@ func cgocall(fn, arg unsafe.Pointer) int32 {
116
114
// Reset traceback.
117
115
mp .cgoCallers [0 ] = 0
118
116
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.
130
126
entersyscall (0 )
131
127
errno := asmcgocall (fn , arg )
132
128
exitsyscall (0 )
0 commit comments