Skip to content

Commit

Permalink
content: move app to cmd/app2
Browse files Browse the repository at this point in the history
  • Loading branch information
changkun committed Jan 25, 2021
1 parent f1b5769 commit b0aa3eb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
Binary file added content/assets/zero-alloc-call-sched/app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion content/assets/zero-alloc-call-sched/app/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewWindow() (*Win, error) {
err error
)
mainthread.Call(func() {
w.win, err = glfw.CreateWindow(640, 480, "", nil, nil)
w.win, err = glfw.CreateWindow(640, 480, "golang.design/research", nil, nil)
if err != nil {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ options:
panic(err)
}

done := make(chan struct{}, 3)
done := make(chan struct{}, 2)
go func() {
defer func() { done <- struct{}{} }()
f, _ := os.Create(*traceF)
defer f.Close()
trace.Start(f)
Expand All @@ -79,5 +78,4 @@ options:
}()
<-done
<-done
<-done
}
2 changes: 0 additions & 2 deletions content/assets/zero-alloc-call-sched/mainthread/mainthread.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ func init() {
func Init(main func()) {
done := donePool.Get().(chan struct{})
defer donePool.Put(done)

go func() {
defer func() {
done <- struct{}{}
Expand All @@ -48,7 +47,6 @@ func Init(main func()) {
func Call(f func()) {
done := donePool.Get().(chan struct{})
defer donePool.Put(done)

funcQ <- funcData{fn: f, done: done}
<-done
}
Expand Down

0 comments on commit b0aa3eb

Please sign in to comment.