apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arsen Chaloyan <achalo...@yahoo.com>
Subject Re: Interruptable pollset
Date Mon, 09 Feb 2009 11:16:45 GMT
Is there anybody who can address the reported issue? I assume it's a trivial one, unless I'm
missing something very obvious.
There is another not so trivial, sporadic issue concerning Windows implementation of interruptable
pollset, but I'm doubtful if it's of any interest internally in the community.


From: Arsen Chaloyan <achaloyan@yahoo.com>
To: dev@apr.apache.org
Sent: Monday, February 2, 2009 5:44:37 PM
Subject: Interruptable pollset

First of all thanks for the robust library, which serves just well and allows my project to
be cross-platform with very small footprint.

I had been looking for interruptable pollset and created small layer on top of apr_pollset_t
in my project based on stable apr-1.2 and apr-1.3 releases.
Meantime I've noticed the following
Changes for APR 1.4.0
  *) Introduce apr_pollset_wakeup() for interrupting the blocking apr_pollset_poll call.
     [Mladen Turk]

Exactly what I need and it just works as intened on Linux, but small note concerning Windows

Pollset is created with an internal pipe object used to interrupt poll if flags contain APR_POLLSET_WAKEABLE.
On Windows, where it's not possible to poll on files, apr_file_socket_pipe_create() function
is used to create a dummy pipe and I'm OK with this either. However the descriptor type should
be APR_POLL_SOCKET instead of APR_POLL_FILE in this case, otherwise apr_pollset_create() always
failes on Windows.

--- apr/poll/unix/select.c    (revision 739958)
+++ apr/poll/unix/select.c    (working copy)
@@ -207,7 +207,7 @@
                                           pollset->pool)) != APR_SUCCESS)
         return rv;
     fd.reqevents = APR_POLLIN;
-    fd.desc_type = APR_POLL_FILE;
+    fd.desc_type = APR_POLL_SOCKET;
     fd.desc.f = pollset->wakeup_pipe[0];


View raw message