Commit Graph

10 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
389c7615eb [core] Revert workaround for std::atomic on ARMv5
Got fix on r12.

https://github.com/android-ndk/ndk/issues/31
2016-07-13 17:56:51 +03:00
Thiago Marcos P. Santos
480e26c53f [android] Add support for timers on the main thread
Wake up the main thread run loop with a file descriptor event from a
thread that exists for this sole purpose.
2016-07-06 17:43:19 +03:00
Thiago Marcos P. Santos
2425cf4ef8 Revert "[android] Do not create Timers on Default main loops"
This reverts commit 13cd75f099.
2016-07-06 17:43:09 +03:00
Thiago Marcos P. Santos
13cd75f099 [android] Do not create Timers on Default main loops
Not supported, because we don't have control over the Looper
timeout like we do for Loopers we create. On the main thread,
Android takes care of making the application sleep and sets
an arbitrary timeout. This could be properly fixed by implementing
timers in Java, but we don't really have the use case of timers
in the main thread.
2016-07-05 21:04:27 +03:00
Thiago Marcos P. Santos
e579199ac1 [android] Fix a bug when canceling tasks
If the next task in the queue gets canceled, we need to
adjust the iterator to the next task, otherwise a canceled
task gets executed.
2016-07-05 21:04:27 +03:00
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
Thiago Marcos P. Santos
b711979e32 [android] #5254 - fix ARMv5 support
Backported patches fixing ARMv5 support for issue #3985.
2016-06-06 23:31:51 +03: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