You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Paul Querna <ch...@force-elite.com> on 2004/09/23 21:04:10 UTC

Break Up each Poll Implmentation

Attached is a patch that moves each Poll & Pollset implementation into
their own file.

This does not include any changes in my previous patch. This only moves
the existing code as it is in CVS to different files.  There are no code
changes. Just removing of lots of #ifdefs and renaming some of the
defines.

Added Files:
include/arch/unix/apr_arch_poll_private.h
poll/unix/poll_epoll.c
poll/unix/poll_kqueue.c
poll/unix/poll_poll.c
poll/unix/poll_select.c

Removed:
poll/unix/poll.c

Builds and works on Linux and OS-X.  I am pretty sure it breaks the
build system on Netware and Windows.

Are there any objections to breaking up this file into one for each
implementations?

The code was becoming impossible to read with some many different
defines.  I believe the minimal amount of code that is now shared
between each file is acceptable, compared to the previous ifdef hell.

-Paul Querna

Re: Break Up each Poll Implmentation

Posted by Joe Orton <jo...@redhat.com>.
On Thu, Sep 23, 2004 at 01:04:10PM -0600, Paul Querna wrote:
> Builds and works on Linux and OS-X.  I am pretty sure it breaks the
> build system on Netware and Windows.
> 
> Are there any objections to breaking up this file into one for each
> implementations?

I think this is a good idea, though I would do s/poll_// on the new
filenames since they already have a 'poll/' prefix...

joe

Re: Break Up each Poll Implmentation

Posted by Paul Querna <ch...@force-elite.com>.
Sigh. I forgot to update the patch file with the updated header...

Just need to move the POLL_USES_* stuff down to its own if/else..

@@ -46,16 +46,21 @@
 #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0
 #endif
 
-/* Choose the best method platform specific to use in apr_pollset */
+/* Choose the best platform specific method to use in apr_pollset_* */
 #ifdef HAVE_KQUEUE
 #define POLLSET_USES_KQUEUE
 #elif defined(HAVE_EPOLL)
 #define POLLSET_USES_EPOLL
 #elif defined(HAVE_POLL)
 #define POLLSET_USES_POLL
-#define POLL_USES_POLL
 #else
 #define POLLSET_USES_SELECT
+#endif
+
+/* Choose the best platform specific method to use in apr_poll() */
+#ifdef HAVE_POLL
+#define POLL_USES_POLL
+#else
 #define POLL_USES_SELECT
 #endif

-Paul