Fixes deadlock between Mouse cuts and xfideventread#102
Fixes deadlock between Mouse cuts and xfideventread#102hherman1 wants to merge 1 commit into9fans:mainfrom
Conversation
When cutting with the mouse it was possible for: 1. Text select to release the biglock, while maintaining a winlock 2. xfideventread to then acquire the biglock, and wait for the winlock Deadlocking. After fixing this deadlock, the following appeared: 1. xfideventwrite releases the big lock, but holds the winlock 2. Text select reacqiures the big lock and blocks on the winlock Another deadlock.
|
This seems to cause a segfault when pasting to acme's top panel because in that situation t.W is nil (in cmd/acme/internal/ui/text.go:550). This should be able to fix that: I also had to increase the size of |
|
The if checking seems like a good change to this diff. I guess I literally never paste in the top bar which is why I didn’t encounter that issue. Are you able to edit this pr directly? I don’t know how often @rsc checks this repo, so I’m also willing to accept this change on my fork in the mean time if that is helpful |
|
Meanwhile I noticed my change breaks copy paste on win because wind.Winlock sets the t.W.Owner to 0. I will keep testing it to make sure nothing else breaks.
I don't think I can :/ |
When cutting with the mouse it was possible for:
Deadlocking. After fixing this deadlock, the following appeared:
Another deadlock.
This was reproducible by me in https://github.com/hherman1/acme-go by running
Watch echo 1 2 3and attempting to cut anything from the Watch window.