<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wayland/src/event-loop.c, branch 1.5</title>
<subtitle>[no description]</subtitle>
<id>http://git.sudomsg.com/mirror/wayland/atom/src/event-loop.c?h=1.5</id>
<link rel='self' href='http://git.sudomsg.com/mirror/wayland/atom/src/event-loop.c?h=1.5'/>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/'/>
<updated>2014-04-30T19:18:52Z</updated>
<entry>
<title>Avoid printing to stderr</title>
<updated>2014-04-30T19:18:52Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2014-04-30T19:18:52Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=88f3bd84c8ea8f0b3526f970388ef76baa231fe2'/>
<id>urn:sha1:88f3bd84c8ea8f0b3526f970388ef76baa231fe2</id>
<content type='text'>
Use wl_log in the last few places where we print to stderr.  Remove
logging in a couple of places where we properly return an error code.

https://bugs.freedesktop.org/show_bug.cgi?id=73339
</content>
</entry>
<entry>
<title>Use non-blocking timerfd to prevent blocking when updating timer event sources</title>
<updated>2014-04-25T21:38:22Z</updated>
<author>
<name>Andrew Wedgbury</name>
<email>andrew.wedgbury@realvnc.com</email>
</author>
<published>2014-04-25T14:00:54Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=3e962728bf547de6316b5a01f40b38e55d3871cf'/>
<id>urn:sha1:3e962728bf547de6316b5a01f40b38e55d3871cf</id>
<content type='text'>
This implements a simple fix for the blocking problem that occurs when
updating a timer event source after the timer expires, but before its
callback is dispatched. This can happen when another event happens during the
same epoll wakeup as the timer event, and causes the read() call in
wl_event_source_timer_dispatch() to block for the updated duration of the
timer.

We never want this read() call to block, so I believe it makes sense for the
timerfd to be non-blocking, and we simply ignore the case where the read fails
with EAGAIN. We still report all other errors as before, and still ignore the
actual value read from the socket.

With this change, the event_loop_timer_updates unit test case I submitted
previously now passes, and weston appears to work as before.
</content>
</entry>
<entry>
<title>server: Make wl_object and wl_resource opaque structs</title>
<updated>2013-07-02T19:52:47Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2013-06-28T01:09:18Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=d94a8722cb29d8b897672be66ff3c9ff79eab6fe'/>
<id>urn:sha1:d94a8722cb29d8b897672be66ff3c9ff79eab6fe</id>
<content type='text'>
With the work to add wl_resource accessors and port weston to use them,
we're ready to make wl_resource and wl_object opaque structs.  We keep
wl_buffer in the header for EGL stacks to use, but don't expose it by
default.  In time we'll remove it completely, but for now it provides a
transition paths for code that still uses wl_buffer.

Reviewed-by: Jason Ekstrand&lt;jason@jlekstrand.net&gt;
</content>
</entry>
<entry>
<title>event-loop: fix returning the destroy-signal listener</title>
<updated>2013-01-24T21:14:33Z</updated>
<author>
<name>David Herrmann</name>
<email>dh.herrmann@googlemail.com</email>
</author>
<published>2013-01-23T13:11:19Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=142aa4a1197f6d4c8a7963dcc762e3d881d249fc'/>
<id>urn:sha1:142aa4a1197f6d4c8a7963dcc762e3d881d249fc</id>
<content type='text'>
We need to actually return the destroy-listener, otherwise the return
value is undefined.

Signed-off-by: David Herrmann &lt;dh.herrmann@googlemail.com&gt;
</content>
</entry>
<entry>
<title>Add a destroy signal to the wl_event_loop object</title>
<updated>2013-01-15T19:05:27Z</updated>
<author>
<name>Jason Ekstrand</name>
<email>jason@jlekstrand.net</email>
</author>
<published>2013-01-12T03:01:47Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=2423497b999c999528a7d2380a13fcb3e3412d0a'/>
<id>urn:sha1:2423497b999c999528a7d2380a13fcb3e3412d0a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move ARRAY_LENGTH out of public headers</title>
<updated>2012-10-19T21:08:38Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2012-10-19T21:08:38Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=bdd272f024744b4ed5ba6daedef7eb023bcac7cb'/>
<id>urn:sha1:bdd272f024744b4ed5ba6daedef7eb023bcac7cb</id>
<content type='text'>
Exporting unprefixed symbols is a pretty bad idea so don't do that.
Instea of redefining it WL_ARRAY_LENGTH, we just move the define to
our private header.  The scanner generates code that uses ARRAY_LENGTH,
but we can just make it count the number elements and emit an integer
constant instead.
</content>
</entry>
<entry>
<title>Change filedescriptor API to be thread safe</title>
<updated>2012-10-11T00:59:00Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2012-10-04T20:54:22Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=53d24713a31d59d9534c1c1a84a7ad46f44ee95f'/>
<id>urn:sha1:53d24713a31d59d9534c1c1a84a7ad46f44ee95f</id>
<content type='text'>
The update callback for the file descriptors was always a bit awkward and
un-intuitive.  The idea was that whenever the protocol code needed to
write data to the fd it would call the 'update' function.  This function
would adjust the mainloop so that it polls for POLLOUT on the fd so we
can eventually flush the data to the socket.

The problem is that in multi-threaded applications, any thread can issue
a request, which writes data to the output buffer and thus triggers the
update callback.  Thus, we'll be calling out with the display mutex
held and may call from any thread.

The solution is to eliminate the udpate callback and just require that
the application or server flushes all connection buffers before blocking.
This turns out to be a simpler API, although we now require clients to
deal with EAGAIN and non-blocking writes.  It also saves a few syscalls,
since the socket will be writable most of the time and most writes will
complete, so we avoid changing epoll to poll for POLLOUT, then write and
then change it back for each write.
</content>
</entry>
<entry>
<title>event-loop: export wl_event_loop_dispatch_idle()</title>
<updated>2012-09-12T16:28:54Z</updated>
<author>
<name>David Herrmann</name>
<email>dh.herrmann@googlemail.com</email>
</author>
<published>2012-09-11T14:09:34Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=003a946aa66333ac1cf927fc1498d85c2c9644f9'/>
<id>urn:sha1:003a946aa66333ac1cf927fc1498d85c2c9644f9</id>
<content type='text'>
When integrating the wayland event-loop into another event-loop, we
currently have no chance of checking whether there are pending idle
sources that have to be called. This patch exports the
"dispatch_idle_sources()" call so other event loops can call this before
going to sleep. This is what wl_event_loop_dispatch() currently does so we
simply allow external event-loops to do the same now.

To avoid breaking existing applications, we keep the call to
dispatch_idle_sources() in wl_event_loop_dispatch() for now. However, if
we want we can remove this later and require every application to call
this manually. This needs to be discussed, but the overhead is negligible
so we will probably leave it as it is.

This finally allows to fully integrate the wayland-server API into
existing event-loops without any nasty workarounds.

Signed-off-by: David Herrmann &lt;dh.herrmann@googlemail.com&gt;
</content>
</entry>
<entry>
<title>event-loop: remove dead code</title>
<updated>2012-09-11T01:28:34Z</updated>
<author>
<name>David Herrmann</name>
<email>dh.herrmann@googlemail.com</email>
</author>
<published>2012-09-08T15:47:15Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=397a0c6ada56e4330ebf2bc662010ca8d32a2c73'/>
<id>urn:sha1:397a0c6ada56e4330ebf2bc662010ca8d32a2c73</id>
<content type='text'>
There is really no need to increment "n" if we never read the value. The
do-while() loop overwrites the value before it is read the first time.

Signed-off-by: David Herrmann &lt;dh.herrmann@googlemail.com&gt;
</content>
</entry>
<entry>
<title>event-loop: Delete fd from epoll when removing event source</title>
<updated>2012-05-08T14:42:42Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2012-05-08T14:42:42Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=c49f632dae67ee3055e4874f028f723663486da6'/>
<id>urn:sha1:c49f632dae67ee3055e4874f028f723663486da6</id>
<content type='text'>
Closing an fd will remove it from the epoll set only if it hasn't been
dup'ed.  In other words, the fd is only removed from epoll when all file
descriptors referring to the open file has been close.  We now dup
fd for fd sources, so we need to use EPOLL_CTL_DEL directly now.
</content>
</entry>
<entry>
<title>event-loop: Consolidate code for setting up new sources</title>
<updated>2012-05-08T13:30:49Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2012-05-08T13:30:49Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=3e7bd7362b6841d1862de5af7b71f138b6d70a5d'/>
<id>urn:sha1:3e7bd7362b6841d1862de5af7b71f138b6d70a5d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>event-loop: fix conditional checking</title>
<updated>2012-05-08T13:08:57Z</updated>
<author>
<name>Tiago Vignatti</name>
<email>tiago.vignatti@intel.com</email>
</author>
<published>2012-05-08T11:58:02Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=a41fa8b3ec42f8f095ff6b53d30f20554b500c17'/>
<id>urn:sha1:a41fa8b3ec42f8f095ff6b53d30f20554b500c17</id>
<content type='text'>
Introduced in:
    commit 80f4f0d5127ebc8d5e35969a29691cf61a79997d
    Author: Jonas Ådahl &lt;jadahl@gmail.com&gt;
    Date:   Wed Mar 21 10:31:24 2012 +0100

Signed-off-by: Tiago Vignatti &lt;tiago.vignatti@intel.com&gt;
</content>
</entry>
<entry>
<title>os: wrap epoll_create</title>
<updated>2012-04-25T06:37:42Z</updated>
<author>
<name>Pekka Paalanen</name>
<email>ppaalanen@gmail.com</email>
</author>
<published>2012-03-22T13:02:05Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=b2eaf870cf8e8cb842ba29ea4718b596101252a6'/>
<id>urn:sha1:b2eaf870cf8e8cb842ba29ea4718b596101252a6</id>
<content type='text'>
Some system C libraries do not have epoll_create1() nor EPOLL_CLOEXEC,
provide a fallback.

Add tests for the wrapper.

Signed-off-by: Pekka Paalanen &lt;ppaalanen@gmail.com&gt;
</content>
</entry>
<entry>
<title>event-loop: Use two-step destruction of event loop sources.</title>
<updated>2012-03-21T14:30:19Z</updated>
<author>
<name>Jonas Ådahl</name>
<email>jadahl@gmail.com</email>
</author>
<published>2012-03-21T09:31:24Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=80f4f0d5127ebc8d5e35969a29691cf61a79997d'/>
<id>urn:sha1:80f4f0d5127ebc8d5e35969a29691cf61a79997d</id>
<content type='text'>
Instead of directly freeing an event source upon removal put it in a
queue later handled by the event loop; either after a dispatch or upon
event loop destruction.

This is necessary to avoid already queued up event sources to be freed
during some other dispatch callback, causing segmentation faults when
the event loop later tries to handle an event from the freed source.

Signed-off-by: Jonas Ådahl &lt;jadahl@gmail.com&gt;
</content>
</entry>
<entry>
<title>event-loop: always do the post-dispatch check</title>
<updated>2012-03-20T19:15:19Z</updated>
<author>
<name>Ander Conselvan de Oliveira</name>
<email>ander.conselvan.de.oliveira@intel.com</email>
</author>
<published>2012-03-13T11:16:13Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=3c5d9694db6f8bcbebc9a8d1ae3afd8e61530089'/>
<id>urn:sha1:3c5d9694db6f8bcbebc9a8d1ae3afd8e61530089</id>
<content type='text'>
The post-dispatch check on wl_event_loop_dispatch() was not being run
if epoll_wait returned 0 events, making the check unreliable.
</content>
</entry>
<entry>
<title>Fix WL_EVENT_WRITEABLE typo</title>
<updated>2011-12-29T03:51:34Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2011-12-29T03:47:37Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=d6465c5b402362c730c703f3f6dd5deddefec113'/>
<id>urn:sha1:d6465c5b402362c730c703f3f6dd5deddefec113</id>
<content type='text'>
</content>
</entry>
<entry>
<title>event-loop: Fix idle handler dispatch corner case</title>
<updated>2011-10-29T18:27:33Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2011-10-29T18:27:33Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=f86338d611305fb84187298cbab5dfc78a698c99'/>
<id>urn:sha1:f86338d611305fb84187298cbab5dfc78a698c99</id>
<content type='text'>
When the last idle handler queues another idle handler, we fail to
dispatch that last handler.  The wl_list_for_each_safe loop looks up
the next pointer before running the handler, and at that point it points
to the head of the list and the loop terminates.

Instead, just loop until the list is empty.
</content>
</entry>
<entry>
<title>event-loop: Quiet a few warnings</title>
<updated>2011-08-12T20:25:18Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2011-08-12T20:23:07Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=efeb9e977885c2df3426346ec45a913ff403af8d'/>
<id>urn:sha1:efeb9e977885c2df3426346ec45a913ff403af8d</id>
<content type='text'>
There's no good error recovery possible in these cases though.
</content>
</entry>
<entry>
<title>Rename source subdir from wayland to src</title>
<updated>2011-08-12T20:25:14Z</updated>
<author>
<name>Kristian Høgsberg</name>
<email>krh@bitplanet.net</email>
</author>
<published>2011-08-12T19:09:00Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/commit/?id=4c260db68c028f05401727d1911582ae8b87cd70'/>
<id>urn:sha1:4c260db68c028f05401727d1911582ae8b87cd70</id>
<content type='text'>
</content>
</entry>
</feed>
