Thiago Marcos P. Santos
47f498e642
[android] Do not try to wake up the RunLoop if a wake is already pending
...
Do not flood the RunLoop with wake up calls, potentially causing the
socket buffer to overflow.
Also, write calls are syscalls and will cause a context switch.
2019-08-07 22:41:12 +03:00
Łukasz Paczos
470b99e795
[android] attach/detach core thread pool's threads to JVM
2019-05-22 15:52:55 +02:00
Ivo van Dongen
1fadf56368
[android] change lock scope in run_loop to avoid deadlocks. simplify as
...
well
2019-02-12 17:56:35 +02:00
Konstantin Käfer
4c7842045a
[android] initialize RunLoop::Impl::nextRunnable iterator
2018-06-19 16:23:59 +02:00
Thiago Marcos P. Santos
7e8bdadb91
[core] Rename ThreadedObject to Thread
...
Now that the old Thread class is gone, we can give ThreadedObject
a better name.
2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
c247a4b10c
[android] Replace util::Thread with util::ThreadedObject
2017-06-21 14:30:09 +03:00
Konstantin Käfer
f436913550
[android] Remove public usage of private util/thread.hpp header
2017-03-28 13:53:19 +02:00
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