Commit Graph

5 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
70d4ebb347 [android] Fix default RunLoop not stopping
stop() for default RunLoop is only used by unit tests and we need
to wake the ALooper to get past run().
2016-07-05 21:04:27 +03:00
John Firebaugh
6e78eabfff [core] Clean up ThreadContext vestiges 2016-04-15 09:56:18 -07:00
Thiago Marcos P. Santos
40e590b681 [android] Use ALooper_addFd() and callbacks to wake up
This is needed for plugging into an existing Looper because
we won't call ::run() on the main thread (this is called
on the Java side of the application automatically by Android).

But we still need to wake up and process the events. For that
we create a pipe and write to the pipe to wake up the main
loop and we process events on the callback of the fd handler.

Fixes #4682
2016-04-14 13:44:08 -07:00
Thiago Marcos P. Santos
10b503eabf [android] Attach thread on the RunLoop
Needed because Looper could be used by Java and it would crash
complaining that we didn't detach otherwise.
2016-04-06 04:52:51 -03:00
Thiago Marcos P. Santos
74a1d3c164 [android] Introduce RunLoop based on Looper
Also implement a Timer and AsyncTask based on Android's Looper.
2016-04-06 04:52:51 -03:00