Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int63 changed to int32 #17

Merged
merged 1 commit into from
Nov 20, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ type Terminal struct {
cfg *Config
state *terminal.State
outchan chan rune
closed int64
closed int32
stopChan chan struct{}
kickChan chan struct{}
wg sync.WaitGroup
isReading int64
isReading int32
}

func NewTerminal(cfg *Config) (*Terminal, error) {
Expand Down Expand Up @@ -61,7 +61,7 @@ func (t *Terminal) ReadRune() rune {
}

func (t *Terminal) IsReading() bool {
return atomic.LoadInt64(&t.isReading) == 1
return atomic.LoadInt32(&t.isReading) == 1
}

func (t *Terminal) KickRead() {
Expand All @@ -83,10 +83,10 @@ func (t *Terminal) ioloop() {
buf := bufio.NewReader(Stdin)
for {
if !expectNextChar {
atomic.StoreInt64(&t.isReading, 0)
atomic.StoreInt32(&t.isReading, 0)
select {
case <-t.kickChan:
atomic.StoreInt64(&t.isReading, 1)
atomic.StoreInt32(&t.isReading, 1)
case <-t.stopChan:
return
}
Expand Down Expand Up @@ -132,7 +132,7 @@ func (t *Terminal) Bell() {
}

func (t *Terminal) Close() error {
if atomic.SwapInt64(&t.closed, 1) != 0 {
if atomic.SwapInt32(&t.closed, 1) != 0 {
return nil
}
t.stopChan <- struct{}{}
Expand Down