Commit graph

14 commits

Author SHA1 Message Date
Andreas Kling
7e1cb86da7 LibHTML: Make it possible to build LibHTML on the host.
- "make" builds the normal Serenity libhtml.a
- "make -f Makefile.host" builds a test program for the host machine.
2019-06-22 21:21:57 +02:00
Andreas Kling
29a9430246 AK: Make timeval_add() and timeval_sub() take references. 2019-06-06 18:02:28 +02:00
Andreas Kling
800242ed4e CEventLoop: Don't bother looking through fds when select() returns 0.
If it returns 0 that just means we hit the timeout. I suppose we could skip
the timer checks if there are a non-zero number of fds marked as well, but
I'm not sure that's a great idea since it will add some latency.
2019-06-05 01:57:28 -07:00
Robin Burchell
0dc9af5f7e Add clang-format file
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
2019-05-28 17:31:20 +02:00
Robin Burchell
8df3e2516f CEventLoop: Make it possible to determine running/quit state without using exec()
... by removing a redundant member that nothing uses (running), and
exposing whether or not quit has been requested.
2019-05-26 18:17:40 +02:00
Robin Burchell
d791bce6af CEventLoop: Allow manually driving the event loop
Move the bulk of exec() into a new pump(). Since SDL wants to drive the
event loop itself, this is a requirement. We also add a WaitMode flag to
allow for immediately pumping events -- again, this is required because
SDL wants to be in full control of the event loop, and not let us wait.
2019-05-20 03:03:48 +02:00
Robin Burchell
df74a9222f Kernel: Fix timeout support in select
The scheduler expects m_select_timeout to act as a deadline. That is, it
should contain the time that a task should wake at -- but we were
directly copying the time from userspace, which meant that it always
returned virtually immediately.

At the same time, fix CEventLoop to not rely on the broken select behavior
by subtracting the current time from the time of the nearest timer.
2019-05-18 02:57:38 +02:00
Andreas Kling
65f2f19b41 CEventLoop: Protect the message queue with a Lock. 2019-04-29 15:57:49 +02:00
Andreas Kling
5eedb22834 Sprinkle use of AK::Vector in various places.
Some of these are less helpful than others. Avoiding a bunch of mallocs
in the event loop wakeup code is definitely nice.
2019-04-20 14:02:19 +02:00
Andreas Kling
405fe4f72c LibCore: Hide deferred_invoke() debug spam. 2019-04-20 12:48:49 +02:00
Andreas Kling
3b986da643 CEventLoop: Don't call gettimeofday() at all if there are no timers. 2019-04-18 13:23:59 +02:00
Andreas Kling
8e0611201e CEventLoop: Consolidate gettimeofday() syscalls. 2019-04-18 01:37:23 +02:00
Andreas Kling
fc1d3074de LibCore: Move LibGUI/GNotifier to LibCore/CNotifier. 2019-04-10 17:35:43 +02:00
Andreas Kling
b2542414d7 LibCore: Add CEventLoop and make LibGUI/GEventLoop inherit from it.
This is shaping up to be quite nice.
2019-04-10 17:30:58 +02:00