2
0
mirror of synced 2025-02-23 23:08:14 +00:00
Nigel Tao 11f6745c3d app: process input and other events concurrently, not consecutively.
Previously, we did:

for {
  processEvents() // Process any pending Android input events.
  select {        // Select Go events (channel send/receives).
  etc
  }
}

The problem was that if you were blocked on the select because there
were no incoming Go events, then you weren't reading new input events,
and the UI could block indefinitely.

After this CL, input events are processed in a dedicated goroutine,
where it's fine for

for C.AInputQueue_getEvent(q, &e) >= 0 { etc }

to block, and the main loop deals only with Go channels:

for {
  select {
  etc
  }
}

Change-Id: I8ec27a40e220b1d95a6b6fc14347a59833ccfdc8
Reviewed-on: https://go-review.googlesource.com/14500
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-09-17 03:05:17 +00:00
..
2015-08-13 13:31:00 +00:00
2015-08-12 04:16:58 +00:00
2015-08-13 13:31:00 +00:00
2015-08-13 13:31:00 +00:00