@@ -6,7 +6,6 @@ package runtime
6
6
7
7
import (
8
8
"runtime/internal/atomic"
9
- "runtime/internal/sys"
10
9
"unsafe"
11
10
)
12
11
@@ -47,9 +46,6 @@ func raiseproc(sig uint32)
47
46
func getthrid () int32
48
47
func thrkill (tid int32 , sig int )
49
48
50
- //go:noescape
51
- func tfork (param * tforkt , psize uintptr , mm * m , gg * g , fn uintptr ) int32
52
-
53
49
//go:noescape
54
50
func thrsleep (ident uintptr , clock_id int32 , tsp * timespec , lock uintptr , abort * uint32 ) int32
55
51
@@ -183,36 +179,6 @@ func semawakeup(mp *m) {
183
179
}
184
180
}
185
181
186
- // May run with m.p==nil, so write barriers are not allowed.
187
- //go:nowritebarrier
188
- func newosproc (mp * m ) {
189
- stk := unsafe .Pointer (mp .g0 .stack .hi )
190
- if false {
191
- print ("newosproc stk=" , stk , " m=" , mp , " g=" , mp .g0 , " id=" , mp .id , " ostk=" , & mp , "\n " )
192
- }
193
-
194
- // Stack pointer must point inside stack area (as marked with MAP_STACK),
195
- // rather than at the top of it.
196
- param := tforkt {
197
- tf_tcb : unsafe .Pointer (& mp .tls [0 ]),
198
- tf_tid : nil , // minit will record tid
199
- tf_stack : uintptr (stk ) - sys .PtrSize ,
200
- }
201
-
202
- var oset sigset
203
- sigprocmask (_SIG_SETMASK , & sigset_all , & oset )
204
- ret := tfork (& param , unsafe .Sizeof (param ), mp , mp .g0 , funcPC (mstart ))
205
- sigprocmask (_SIG_SETMASK , & oset , nil )
206
-
207
- if ret < 0 {
208
- print ("runtime: failed to create new OS thread (have " , mcount ()- 1 , " already; errno=" , - ret , ")\n " )
209
- if ret == - _EAGAIN {
210
- println ("runtime: may need to increase max user processes (ulimit -p)" )
211
- }
212
- throw ("runtime.newosproc" )
213
- }
214
- }
215
-
216
182
func osinit () {
217
183
ncpu = getncpu ()
218
184
physPageSize = getPageSize ()
0 commit comments