Skip to content

Commit 6b212e1

Browse files
author
Naoya Yokoyama
committed
makefile update
1 parent db789f8 commit 6b212e1

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

main.go

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -419,21 +419,6 @@ type Pauser struct {
419419
DrawMux sync.Mutex
420420
}
421421

422-
func newPauser() *Pauser {
423-
var (
424-
mu1 sync.Mutex
425-
mu2 sync.Mutex
426-
)
427-
mu1.Lock() //Mutex is availablize.
428-
mu2.Lock() //Mutex is availablize.
429-
stop := make(chan struct{}, 0)
430-
return &Pauser{
431-
Stop: stop,
432-
MainMux: mu1,
433-
DrawMux: mu2,
434-
}
435-
}
436-
437422
/*This is Main loop*/
438423
func drawLoop(maxX, maxY int, pauser *Pauser) {
439424

@@ -769,7 +754,11 @@ func main() {
769754
sleep := false
770755

771756
/*pauser give pause implementation*/
772-
pauser := newPauser()
757+
pauser := &Pauser{
758+
Stop: make(chan struct{}, 0),
759+
}
760+
pauser.MainMux.Lock()
761+
pauser.DrawMux.Lock()
773762

774763
go keyEventLoop(killKey)
775764
go drawLoop(maxX, maxY, pauser)

0 commit comments

Comments
 (0)