diff options
Diffstat (limited to 'poll/unix/pollcb.c')
-rw-r--r-- | poll/unix/pollcb.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index 103ab9fa6..a63ad5c9c 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -23,7 +23,6 @@ #include "apr_poll.h" #include "apr_time.h" #include "apr_portable.h" -#include "apr_atomic.h" #include "apr_arch_file_io.h" #include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" @@ -135,7 +134,6 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, pollcb->flags = flags; pollcb->pool = p; pollcb->provider = provider; - pollcb->wakeup_set = 0; rv = (*provider->create)(pollcb, size, p, flags); if (rv == APR_ENOTIMPL) { @@ -214,13 +212,10 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, APR_DECLARE(apr_status_t) apr_pollcb_wakeup(apr_pollcb_t *pollcb) { - if (!(pollcb->flags & APR_POLLSET_WAKEABLE)) - return APR_EINIT; - - if (apr_atomic_cas32(&pollcb->wakeup_set, 1, 0) == 0) + if (pollcb->flags & APR_POLLSET_WAKEABLE) return apr_file_putc(1, pollcb->wakeup_pipe[1]); - - return APR_SUCCESS; + else + return APR_EINIT; } APR_DECLARE(const char *) apr_pollcb_method_name(apr_pollcb_t *pollcb) |