Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 8 additions & 2 deletions cmd/acme/internal/ui/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,17 +473,23 @@ func Textselect(t *wind.Text) {
// Do just the receive, dropping biglock
// to let other goroutines proceed.
// Note that *Mouse is Mousectl.Mouse.
// We also need to release the window lock, or else other code
// will deadlock with us by acquiring the big lock and _then_ acquiring
// the window lock
o := t.W.Owner
wind.Winunlock(t.W)
BigUnlock()
for Mouse.Buttons == b {
*Mouse = <-Mousectl.C
}
BigLock()
wind.Winlock(t.W, o)
clicktext = nil
}
}

var BigLock = func(){}
var BigUnlock = func(){}
var BigLock = func() {}
var BigUnlock = func() {}

/*
* Release the button in less than DELAY ms and it's considered a null selection
Expand Down
3 changes: 3 additions & 0 deletions cmd/acme/xfid.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,12 @@ func xfideventwrite(x *Xfid, w *wind.Window) {
goto Rescue
}

o := w.Owner
wind.Winunlock(w)
bigUnlock()
wind.TheRow.Lk.Lock() // just like mousethread
bigLock()
wind.Winlock(w, o)
switch c {
case 'x',
'X':
Expand Down