Skip to content

Commit

Permalink
runtime: move gosched to Go, to add stack frame information
Browse files Browse the repository at this point in the history
LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/134520044
  • Loading branch information
rsc committed Sep 11, 2014
1 parent 724fa12 commit 15a5c35
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/runtime/malloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ func gogc(force int32) {
// now that gc is done, kick off finalizer thread if needed
if !concurrentSweep {
// give the queued finalizers, if any, a chance to run
gosched()
Gosched()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/mgc0.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func bgsweep() {
for {
for gosweepone() != ^uintptr(0) {
sweep.nbgsweep++
gosched()
Gosched()
}
lock(&gclock)
if !gosweepdone() {
Expand Down
13 changes: 1 addition & 12 deletions src/runtime/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,18 +1677,7 @@ runtime·park_m(G *gp)
schedule();
}

// Scheduler yield.
#pragma textflag NOSPLIT
void
runtime·gosched(void)
{
void (*fn)(G*);

fn = runtime·gosched_m;
runtime·mcall(&fn);
}

// runtime·gosched continuation on g0.
// Gosched continuation on g0.
void
runtime·gosched_m(G *gp)
{
Expand Down
1 change: 0 additions & 1 deletion src/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ void runtime·setg(G*);
void runtime·newextram(void);
void runtime·exit(int32);
void runtime·breakpoint(void);
void runtime·gosched(void);
void runtime·gosched_m(G*);
void runtime·schedtrace(bool);
void runtime·park(bool(*)(G*, void*), void*, String);
Expand Down
1 change: 0 additions & 1 deletion src/runtime/stubs.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ func memclr(ptr unsafe.Pointer, n uintptr)
//go:noescape
func memmove(to unsafe.Pointer, from unsafe.Pointer, n uintptr)

func gosched()
func starttheworld()
func stoptheworld()
func newextram()
Expand Down

0 comments on commit 15a5c35

Please sign in to comment.