Commit Graph

19 Commits

Author SHA1 Message Date
Chris Loer
5da5ba7706 [core, ios, qt, android] Close race condition in RunLoop (issue #9620)
Because a message we queue from the foreground may cause the background to complete, exit, and tear down the AsyncTask, we have to block queue processing until we've finished our call to AsyncTask::send().
Broadening the scope of a mutex is scary, but I audited the code of our four implementations of AsyncTask and I don't see any way this could cause a deadlock.
2017-11-27 14:42:44 -08:00
Ivo van Dongen
f4f4d13b70 [all] ensure runloop is the current scheduler 2017-08-09 12:08:21 +03:00
John Firebaugh
a0a69ad6a7 [node, glfw] Don't throw in destructor 2017-03-10 15:03:18 -08:00
John Firebaugh
b05e19b389 [node, glfw] Remove libuv 0.10 support 2017-03-10 15:03:18 -08:00
Thiago Marcos P. Santos
036acf23cd [default] uv_run should use UV_RUN_NOWAIT
UV_RUN_ONCE might block and that is not the semantics we expect
from RunLoop::runOnce().
2016-07-22 16:29:08 +03:00
Konstantin Käfer
2bdecdf9f9 [core] fix pedantic warning messages 2016-06-13 11:16:19 +02:00
John Firebaugh
8fee0f33c0 [core] Fix RunLoop::run() behavior when called a second time 2016-03-08 10:28:01 -08:00
Thiago Marcos P. Santos
931ac77af4 Revert "[core] libuv unref() not really needed"
This reverts commit 8a53c1a881.
2016-02-24 14:31:11 +02:00
Thiago Marcos P. Santos
8a53c1a881 [core] libuv unref() not really needed
The run loop will be kept alive because it has an `AsyncTask`. We
also can simple stop the loop with `uv_stop()`.

The `RunLoop` is still gonna be the last object to be destroyed
because it is the first object to be created in the thread, so
by design it won't outlive `Timer`s and `AsyncTask`s.

This patch won't change the current behavior, will just make
the code simpler.
2016-02-20 13:33:13 +02:00
John Firebaugh
d66d145c6e [core] Remove RunLoop::{ref,unref} 2016-02-16 12:48:50 -08:00
Thiago Marcos P. Santos
55c31493af [core] Add ref counting to the main loop
Should not be used at all, added for a corner case
on OSX network backend where the request is processed on
a worker thread managed by OSX and we need to wait for
that reply before destroying the thread that pushed the
request.
2016-01-20 19:54:20 +02:00
Thiago Marcos P. Santos
d7fdcc73bf [core] Get rid of ::unref() for Timer and AsyncTask
Not need, legacy from libuv. The RunLoop keep the main
loop running until is explicitly no longer needed.
2016-01-09 01:26:29 +02:00
Thiago Marcos P. Santos
0a97145d05 [core] Better C++ usage on RunLoop
Follow-up of #3179.
2015-12-08 10:23:11 -08:00
Konstantin Käfer
d5fb535058 [core] add namespace comment to closing brace 2015-12-03 15:38:36 +01:00
Thiago Marcos P. Santos
ed29223e5a [core] Remove mbgl/util/uv.hpp
Now only a few things depend on libuv and they can use it directly.
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
07c0424ab9 [core] Removed libuv dependency from HTTPCurl*
Moved the fd watcher to the RunLoop. So far only needs to
be implemented by platforms using HTTPCurlRequest et al.
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
62990f0a21 [core] Port uv::tls to pthreads 2015-12-01 11:49:02 +02:00
John Firebaugh
1c63f98f6d [core] Expose fewer RunLoop implementation details in header 2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
d422c8cac4 [core] Abstract main loop inside RunLoop class 2015-12-01 00:00:09 +02:00