<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wayland/src/event-loop.c, branch 1.0.2</title>
<subtitle>[no description]</subtitle>
<id>http://git.sudomsg.com/mirror/wayland/atom/src/event-loop.c?h=1.0.2</id>
<link rel='self' href='http://git.sudomsg.com/mirror/wayland/atom/src/event-loop.c?h=1.0.2'/>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/wayland/'/>
<updated>2012-10-19T21:08:38Z</updated>
<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>
