mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
Revert "app: [Wayland] avoid a race on the send side of the wakeup pipe"
This reverts commit 7fde80e805, because
Wakeup can no longer be called after the window has been destroyed.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-11
@@ -94,10 +94,7 @@ type wlDisplay struct {
|
|||||||
|
|
||||||
// Notification pipe fds.
|
// Notification pipe fds.
|
||||||
notify struct {
|
notify struct {
|
||||||
read int
|
read, write int
|
||||||
|
|
||||||
mu sync.Mutex
|
|
||||||
write int
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repeat repeatState
|
repeat repeatState
|
||||||
@@ -1445,11 +1442,6 @@ func (w *window) SetAnimating(anim bool) {
|
|||||||
// Wakeup wakes up the event loop through the notification pipe.
|
// Wakeup wakes up the event loop through the notification pipe.
|
||||||
func (d *wlDisplay) wakeup() {
|
func (d *wlDisplay) wakeup() {
|
||||||
oneByte := make([]byte, 1)
|
oneByte := make([]byte, 1)
|
||||||
d.notify.mu.Lock()
|
|
||||||
defer d.notify.mu.Unlock()
|
|
||||||
if d.notify.write == 0 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if _, err := syscall.Write(d.notify.write, oneByte); err != nil && err != syscall.EAGAIN {
|
if _, err := syscall.Write(d.notify.write, oneByte); err != nil && err != syscall.EAGAIN {
|
||||||
panic(fmt.Errorf("failed to write to pipe: %v", err))
|
panic(fmt.Errorf("failed to write to pipe: %v", err))
|
||||||
}
|
}
|
||||||
@@ -1828,12 +1820,10 @@ func newWLDisplay() (*wlDisplay, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *wlDisplay) destroy() {
|
func (d *wlDisplay) destroy() {
|
||||||
d.notify.mu.Lock()
|
|
||||||
if d.notify.write != 0 {
|
if d.notify.write != 0 {
|
||||||
syscall.Close(d.notify.write)
|
syscall.Close(d.notify.write)
|
||||||
d.notify.write = 0
|
d.notify.write = 0
|
||||||
}
|
}
|
||||||
d.notify.mu.Unlock()
|
|
||||||
if d.notify.read != 0 {
|
if d.notify.read != 0 {
|
||||||
syscall.Close(d.notify.read)
|
syscall.Close(d.notify.read)
|
||||||
d.notify.read = 0
|
d.notify.read = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user