diff options
author | (no author) <(no author)@unknown> | 2004-07-07 15:47:09 +0000 |
---|---|---|
committer | (no author) <(no author)@unknown> | 2004-07-07 15:47:09 +0000 |
commit | b8ff5545af62e29e0ab0d1d2f6036d6cbc3e1d86 (patch) | |
tree | 5a688b74bb444d61d4b7cc2211d3c74de3b1b69d | |
parent | 90d773fa9ce5c750a045a13443cdc00d1365ac61 (diff) | |
download | apr-APR_1_0_0_RC3.tar.gz apr-APR_1_0_0_RC3.zip |
This commit was manufactured by cvs2svn to create tagAPR_1_0_0_RC3
'APR_1_0_0_RC3'.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/tags/APR_1_0_0_RC3@65267 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | .cvsignore | 2 | ||||
-rw-r--r-- | CHANGES | 8 | ||||
-rwxr-xr-x | buildconf | 16 | ||||
-rw-r--r-- | configure.in | 18 | ||||
-rw-r--r-- | file_io/os2/filesys.c | 13 | ||||
-rw-r--r-- | misc/unix/charset.c | 2 | ||||
-rw-r--r-- | poll/unix/poll.c | 371 | ||||
-rw-r--r-- | renames_pending | 39 | ||||
-rw-r--r-- | test/testpoll.c | 12 | ||||
-rw-r--r-- | threadproc/beos/.cvsignore | 1 | ||||
-rw-r--r-- | threadproc/beos/threadcancel.c | 88 | ||||
-rw-r--r-- | threadproc/os2/threadcancel.c | 85 | ||||
-rw-r--r-- | threadproc/win32/threadcancel.c | 86 |
13 files changed, 24 insertions, 717 deletions
diff --git a/.cvsignore b/.cvsignore index 29ab2740f..4b17e2735 100644 --- a/.cvsignore +++ b/.cvsignore @@ -38,4 +38,4 @@ build-outputs.mk *.bbg *.da coverage -apr*.pc +apr.pc @@ -7,14 +7,6 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 - *) Add support for KQueue and sys_epoll to apr_pollset. [Paul Querna] - - *) Support threading on FreeBSD 5.x where kern.osreldate >= 502102. - [Craig Rodrigues <rodrigc crodrigues.org>] - - *) Add an RPM spec file derived from Fedora Core. - [Graham Leggett, Joe Orton] - *) Fix apr_threadattr_detach_set() on Mac OS X. PR 28472. [INOUE Seiichiro <inoue ariel-networks.com>] @@ -83,20 +83,4 @@ rm -rf autom4te*.cache echo "Generating 'make' outputs ..." build/gen-build.py make -# Create RPM Spec file -if [ -f `which cut` ]; then - echo rebuilding rpm spec file - ( REVISION=`build/get-version.sh all include/apr_version.h APR` - VERSION=`echo $REVISION | cut -d- -s -f1` - RELEASE=`echo $REVISION | cut -d- -s -f2` - if [ "x$VERSION" = "x" ]; then - VERSION=$REVISION - RELEASE=1 - fi - cat ./build/rpm/apr.spec.in | \ - sed -e "s/APR_VERSION/$VERSION/" \ - -e "s/APR_RELEASE/$RELEASE/" \ - > apr.spec ) -fi - exit 0 diff --git a/configure.in b/configure.in index f9e0ea396..3d2f311cf 100644 --- a/configure.in +++ b/configure.in @@ -636,23 +636,7 @@ AC_SUBST(threads) AC_SUBST(have_sigsuspend) AC_SUBST(have_sigwait) -AC_CHECK_FUNCS(poll kqueue) - -# Check for the Linux epoll interface; epoll* may be available in libc -# but return ENOSYS on a pre-2.6 kernel, so do a run-time check. -AC_CACHE_CHECK([for epoll support], [apr_cv_epoll], -[AC_TRY_RUN([ -#include <sys/epoll.h> -#include <unistd.h> - -int main() -{ - return epoll_create(5) == -1; -}], [apr_cv_epoll=yes], [apr_cv_epoll=no], [apr_cv_epoll=no])]) - -if test "$apr_cv_epoll" = "yes"; then - AC_DEFINE([HAVE_EPOLL], 1, [Define if the epoll interface is supported]) -fi +AC_CHECK_FUNCS(poll) dnl ----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r]) diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index ef597b38e..b323e488d 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -94,13 +94,12 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) { - if (root[0] && apr_islower(root[0]) && root[1] == ':') { - *rootpath = apr_pstrdup(p, root); - (*rootpath)[0] = apr_toupper((*rootpath)[0]); - } - else { - *rootpath = root; - } + char path[APR_PATH_MAX]; + + strcpy(path, root); + if (path[1] == ':') + path[0] = apr_toupper(path[0]); + *rootpath = apr_pstrdup(p, path); return APR_SUCCESS; } diff --git a/misc/unix/charset.c b/misc/unix/charset.c index 6acb4e157..5e1842fac 100644 --- a/misc/unix/charset.c +++ b/misc/unix/charset.c @@ -55,7 +55,7 @@ APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) } if ('A' == 0x41) { - return "ISO-8859-1"; /* not necessarily true */ + return "ISO8859-1"; /* not necessarily true */ } return "unknown"; diff --git a/poll/unix/poll.c b/poll/unix/poll.c index a04866fcd..c792d0a65 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -26,77 +26,12 @@ #include <sys/poll.h> #endif -#ifdef HAVE_KQUEUE -#include <sys/types.h> -#include <sys/event.h> -#include <sys/time.h> -#endif - -#ifdef HAVE_EPOLL -#include <sys/epoll.h> -#endif #ifdef NETWARE #define HAS_SOCKETS(dt) (dt == APR_POLL_SOCKET) ? 1 : 0 #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif -#ifdef HAVE_KQUEUE -static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) -{ - apr_int16_t rv = 0; - - if (event & EVFILT_READ) - rv |= APR_POLLIN; - if (event & EVFILT_WRITE) - rv |= APR_POLLOUT; - if (flags & EV_ERROR || flags & EV_EOF) - rv |= APR_POLLERR; - - return rv; -} - -#endif - -#ifdef HAVE_EPOLL -static apr_int16_t get_epoll_event(apr_int16_t event) -{ - apr_int16_t rv = 0; - - if (event & APR_POLLIN) - rv |= EPOLLIN; - if (event & APR_POLLPRI) - rv |= EPOLLPRI; - if (event & APR_POLLOUT) - rv |= EPOLLOUT; - if (event & APR_POLLERR) - rv |= EPOLLERR; - if (event & APR_POLLHUP) - rv |= EPOLLHUP; - /* APR_POLLNVAL is not handled by epoll. */ - - return rv; -} - -static apr_int16_t get_epoll_revent(apr_int16_t event) -{ - apr_int16_t rv = 0; - - if (event & EPOLLIN) - rv |= APR_POLLIN; - if (event & EPOLLPRI) - rv |= APR_POLLPRI; - if (event & EPOLLOUT) - rv |= APR_POLLOUT; - if (event & EPOLLERR) - rv |= APR_POLLERR; - if (event & EPOLLHUP) - rv |= APR_POLLHUP; - /* APR_POLLNVAL is not handled by epoll. */ - - return rv; -} -#endif #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ @@ -349,18 +284,9 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n #endif struct apr_pollset_t { - apr_pool_t *pool; - apr_uint32_t nelts; apr_uint32_t nalloc; -#ifdef HAVE_KQUEUE - int kqueue_fd; - struct kevent kevent; - struct kevent *ke_set; -#elif defined(HAVE_EPOLL) - int epoll_fd; - struct epoll_event *pollset; -#elif defined(HAVE_POLL) +#ifdef HAVE_POLL struct pollfd *pollset; #else fd_set readset, writeset, exceptset; @@ -374,25 +300,12 @@ struct apr_pollset_t { #endif }; -#if defined(HAVE_KQUEUE) || defined(HAVE_EPOLL) -static apr_status_t backend_cleanup(void *p_) -{ - apr_pollset_t *pollset = (apr_pollset_t *)p_; -#ifdef HAVE_KQUEUE - close(pollset->kqueue_fd); -#elif defined(HAVE_EPOLL) - close(pollset->epoll_fd); -#endif - return APR_SUCCESS; -} -#endif /* HAVE_KQUEUE || HAVE_EPOLL */ - APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags) { -#if !defined(HAVE_KQUEUE) && !defined(HAVE_EPOLL) && !defined(HAVE_POLL) && defined(FD_SETSIZE) +#if !defined(HAVE_POLL) && defined(FD_SETSIZE) if (size > FD_SETSIZE) { *pollset = NULL; return APR_EINVAL; @@ -401,22 +314,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, *pollset = apr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; - (*pollset)->pool = p; -#ifdef HAVE_KQUEUE - (*pollset)->ke_set = (struct kevent*)apr_palloc(p, size * sizeof(struct kevent)); - memset((*pollset)->ke_set, 0, size * sizeof(struct kevent)); - (*pollset)->kqueue_fd = kqueue(); - if ((*pollset)->kqueue_fd == -1) { - return APR_ENOMEM; - } - apr_pool_cleanup_register(p, (void*)(*pollset), backend_cleanup, - apr_pool_cleanup_null); -#elif defined(HAVE_EPOLL) - (*pollset)->epoll_fd = epoll_create(size); - (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); - apr_pool_cleanup_register(p, (void*)(*pollset), backend_cleanup, - apr_pool_cleanup_null); -#elif defined(HAVE_POLL) +#ifdef HAVE_POLL (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd)); #else FD_ZERO(&((*pollset)->readset)); @@ -435,75 +333,25 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) { -#if defined(HAVE_KQUEUE) || defined(HAVE_EPOLL) - return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); -#else + /* A no-op function for now. If we later implement /dev/poll + * support, we'll need to close the /dev/poll fd here + */ return APR_SUCCESS; -#endif } APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { -#ifdef HAVE_KQUEUE - apr_os_sock_t fd; -#elif defined(HAVE_EPOLL) - struct epoll_event ev; - int ret = -1; -#else -#if !defined(HAVE_POLL) +#ifndef HAVE_POLL apr_os_sock_t fd; #endif -#endif if (pollset->nelts == pollset->nalloc) { return APR_ENOMEM; } pollset->query_set[pollset->nelts] = *descriptor; - -#ifdef HAVE_KQUEUE - if (descriptor->desc_type == APR_POLL_SOCKET) { - fd = descriptor->desc.s->socketdes; - } - else { - fd = descriptor->desc.f->filedes; - } - - if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->kevent, fd, EVFILT_READ, EV_ADD, 0, 0, NULL); - - if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, - NULL) == -1) { - return APR_ENOMEM; - } - } - - if (descriptor->reqevents & APR_POLLOUT) { - EV_SET(&pollset->kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, NULL); - - if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, - NULL) == -1) { - return APR_ENOMEM; - } - } - -#elif defined(HAVE_EPOLL) - ev.events = get_epoll_event(descriptor->reqevents); - if (descriptor->desc_type == APR_POLL_SOCKET) { - ev.data.fd = descriptor->desc.s->socketdes; - ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD, - descriptor->desc.s->socketdes, &ev); - } - else { - ev.data.fd = descriptor->desc.f->filedes; - ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD, - descriptor->desc.f->filedes, &ev); - } - if (0 != ret) { - return APR_EBADF; - } -#elif defined(HAVE_POLL) +#ifdef HAVE_POLL if (descriptor->desc_type == APR_POLL_SOCKET) { pollset->pollset[pollset->nelts].fd = descriptor->desc.s->socketdes; @@ -572,97 +420,11 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { apr_uint32_t i; -#ifdef HAVE_KQUEUE - apr_os_sock_t fd; -#elif defined(HAVE_EPOLL) - struct epoll_event ev; - int ret = -1; -#elif !defined(HAVE_POLL) +#ifndef HAVE_POLL apr_os_sock_t fd; #endif -#ifdef HAVE_KQUEUE - for (i = 0; i < pollset->nelts; i++) { - if (descriptor->desc.s == pollset->query_set[i].desc.s) { - /* Found an instance of the fd: remove this and any other copies */ - apr_uint32_t dst = i; - apr_uint32_t old_nelts = pollset->nelts; - pollset->nelts--; - for (i++; i < old_nelts; i++) { - if (descriptor->desc.s == pollset->query_set[i].desc.s) { - pollset->nelts--; - } - else { - pollset->query_set[dst] = pollset->query_set[i]; - dst++; - } - } - - if (descriptor->desc_type == APR_POLL_SOCKET) { - fd = descriptor->desc.s->socketdes; - } - else { - fd = descriptor->desc.f->filedes; - } - - if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->kevent, fd, - EVFILT_READ, EV_DELETE, 0, 0, NULL); - - if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, - NULL) == -1) { - return APR_EBADF; - } - } - - if (descriptor->reqevents & APR_POLLOUT) { - EV_SET(&pollset->kevent, fd, - EVFILT_WRITE, EV_DELETE, 0, 0, NULL); - - if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, - NULL) == -1) { - return APR_EBADF; - } - } - - return APR_SUCCESS; - } - } -#elif defined(HAVE_EPOLL) - for (i = 0; i < pollset->nelts; i++) { - if (descriptor->desc.s == pollset->query_set[i].desc.s) { - /* Found an instance of the fd: remove this and any other copies */ - apr_uint32_t dst = i; - apr_uint32_t old_nelts = pollset->nelts; - pollset->nelts--; - for (i++; i < old_nelts; i++) { - if (descriptor->desc.s == pollset->query_set[i].desc.s) { - pollset->nelts--; - } - else { - pollset->query_set[dst] = pollset->query_set[i]; - dst++; - } - } - ev.events = get_epoll_event(descriptor->reqevents); - if (descriptor->desc_type == APR_POLL_SOCKET) { - ev.data.fd = descriptor->desc.s->socketdes; - ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL, - descriptor->desc.s->socketdes, &ev); - } - else { - ev.data.fd = descriptor->desc.f->filedes; - ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL, - descriptor->desc.f->filedes, &ev); - } - if (ret < 0) { - return APR_EBADF; - } - - return APR_SUCCESS; - } - } -#elif defined(HAVE_POLL) +#ifdef HAVE_POLL for (i = 0; i < pollset->nelts; i++) { if (descriptor->desc.s == pollset->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ @@ -723,119 +485,8 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return APR_NOTFOUND; } -#ifdef HAVE_KQUEUE -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) -{ - int rv; - apr_uint32_t i, j, r = 0; - struct timespec tv, *tvptr; - - if (timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = (long)apr_time_sec(timeout); - tv.tv_nsec = (long)apr_time_msec(timeout); - tvptr = &tv; - } - - rv = kevent(pollset->kqueue_fd, NULL, 0, pollset->ke_set, pollset->nelts, - tvptr); - (*num) = rv; - if (rv < 0) { - return apr_get_netos_error(); - } - if (rv == 0) { - return APR_TIMEUP; - } - - /* TODO: Is there a better way to re-associate our data? */ - for (i = 0; i < pollset->nelts; i++) { - apr_os_sock_t fd; - if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) { - fd = pollset->query_set[i].desc.s->socketdes; - } - else { - fd = pollset->query_set[i].desc.f->filedes; - } - for (j = 0; j < rv; j++) { - if (pollset->ke_set[j].ident == fd ) { - pollset->result_set[r] = pollset->query_set[i]; - pollset->result_set[r].rtnevents = - get_kqueue_revent(pollset->ke_set[j].filter, - pollset->ke_set[j].flags); - r++; - } - } - } - - (*num) = r; - - if (descriptors) { - *descriptors = pollset->result_set; - } - - return APR_SUCCESS; -} - -#elif defined(HAVE_EPOLL) - -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) -{ - int rv; - apr_uint32_t i, j, k; - - if (timeout > 0) { - timeout /= 1000; - } - rv = epoll_wait(pollset->epoll_fd, pollset->pollset, pollset->nelts, - timeout); - (*num) = rv; - if (rv < 0) { - return apr_get_netos_error(); - } - if (rv == 0) { - return APR_TIMEUP; - } - j = 0; - for (i = 0; i < pollset->nelts; i++) { - if (pollset->pollset[i].events != 0) { - /* TODO: Is there a better way to re-associate our data? */ - for (k = 0; k < pollset->nelts; k++) { - if (pollset->query_set[k].desc_type == APR_POLL_SOCKET && - pollset->query_set[k].desc.s->socketdes == - pollset->pollset[i].data.fd) { - pollset->result_set[j] = pollset->query_set[k]; - pollset->result_set[j].rtnevents = - get_epoll_revent(pollset->pollset[i].events); - j++; - break; - } - else if (pollset->query_set[k].desc_type == APR_POLL_FILE - && pollset->query_set[k].desc.f->filedes == - pollset->pollset[i].data.fd) { - pollset->result_set[j] = pollset->query_set[k]; - pollset->result_set[j].rtnevents = - get_epoll_revent(pollset->pollset[i].events); - j++; - break; - } - } - } - } - if (descriptors) { - *descriptors = pollset->result_set; - } - return APR_SUCCESS; -} -#elif defined(HAVE_POLL) +#ifdef HAVE_POLL APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, apr_int32_t *num, diff --git a/renames_pending b/renames_pending deleted file mode 100644 index ca007a729..000000000 --- a/renames_pending +++ /dev/null @@ -1,39 +0,0 @@ -Pending symbol renames for APR [for some discussion yet] - -apr_file_info_t from apr_finfo_t -apr_file_attrs_t from apr_fileattrs_t -apr_file_seek_where_t from apr_seek_where_t - -#apr_filepath_name_get from apr_filename_of_pathname - -apr_lock_mech_e from apr_lockmech_e - -#apr_gid_get from apr_get_groupid -#apr_gid_name_get from apr_get_groupname -#apr_gid_name_get from apr_group_name_get -#apr_gid_compare from apr_compare_groups - -#apr_socket_shutdown from apr_shutdown -#apr_socket_bind from apr_bind -#apr_socket_listen from apr_listen -#apr_socket_accept from apr_accept -#apr_socket_connect from apr_connect -#apr_socket_send from apr_send -#apr_socket_sendv from apr_sendv -#apr_socket_sendto from apr_sendto -#apr_socket_recvfrom from apr_recvfrom -#apr_socket_sendfile from apr_sendfile -#apr_socket_recv from apr_recv -#apr_socket_inherit_set from apr_socket_set_inherit -#apr_socket_inherit_unset from apr_socket_unset_inherit - - -#apr_time_exp_gmt_get from apr_implode_gmt -apr_time_interval_t from apr_interval_time_t -apr_time_interval_short_t from apr_short_interval_time_t - -#apr_uid_homepath_get from apr_get_home_directory -#apr_uid_get from apr_get_userid -#apr_uid_current from apr_current_userid -#apr_uid_compare from apr_compare_users -#apr_uid_name_get from apr_get_username diff --git a/test/testpoll.c b/test/testpoll.c index 690884a91..23a824dbd 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -489,14 +489,10 @@ static void pollset_remove(abts_case *tc, void *data) rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 2, num); - ABTS_ASSERT(tc, "Incorrect socket in result set", - ((hot_files[0].desc.s == s[0]) && (hot_files[1].desc.s == s[3])) || - ((hot_files[0].desc.s == s[3]) && (hot_files[1].desc.s == s[0]))); - ABTS_ASSERT(tc, "Incorrect client data in result set", - ((hot_files[0].client_data == (void *)1) && - (hot_files[1].client_data == (void *)4)) || - ((hot_files[0].client_data == (void *)4) && - (hot_files[1].client_data == (void *)1))); + ABTS_PTR_EQUAL(tc, (void *)1, hot_files[0].client_data); + ABTS_PTR_EQUAL(tc, s[0], hot_files[0].desc.s); + ABTS_PTR_EQUAL(tc, (void *)4, hot_files[1].client_data); + ABTS_PTR_EQUAL(tc, s[3], hot_files[1].desc.s); } abts_suite *testpoll(abts_suite *suite) diff --git a/threadproc/beos/.cvsignore b/threadproc/beos/.cvsignore index f82426797..11f54a843 100644 --- a/threadproc/beos/.cvsignore +++ b/threadproc/beos/.cvsignore @@ -1,6 +1,5 @@ Makefile apr_proc_stub *.lo -*.slo .libs .deps diff --git a/threadproc/beos/threadcancel.c b/threadproc/beos/threadcancel.c deleted file mode 100644 index 94a7e9407..000000000 --- a/threadproc/beos/threadcancel.c +++ /dev/null @@ -1,88 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "threadproc.h" - - -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - if (kill_thread(thd->td) == 0) { - return APR_SUCCESS; - } - else { - return errno; - } -} - - -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ -/* if (pthread_setcanceltype(type, NULL) == 0) {*/ - return APR_SUCCESS; -/* } - else { - return APR_FAILURE; - }*/ -} - -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ -/* if (pthread_setcanceltype(type, NULL) == 0) {*/ - return APR_SUCCESS; -/* } - else { - return APR_FAILURE; - }*/ -} - diff --git a/threadproc/os2/threadcancel.c b/threadproc/os2/threadcancel.c deleted file mode 100644 index ca7a18753..000000000 --- a/threadproc/os2/threadcancel.c +++ /dev/null @@ -1,85 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "threadproc.h" -#include "apr_thread_proc.h" -#include "apr_general.h" -#include "fileio.h" - -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - return APR_OS2_STATUS(DosKillThread(thd->tid)); -} - - - -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ - ULONG rc, nesting; - - if (type == APR_CANCEL_DEFER) - rc = DosEnterMustComplete(&nesting); - else - rc = DosExitMustComplete(&nesting); - - return APR_OS2_STATUS(rc); -} - - - -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ -/* There's no way to ignore thread kills altogether in OS/2 (that I know of) */ - return APR_ENOTIMPL; -} diff --git a/threadproc/win32/threadcancel.c b/threadproc/win32/threadcancel.c deleted file mode 100644 index 3a509202b..000000000 --- a/threadproc/win32/threadcancel.c +++ /dev/null @@ -1,86 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "threadproc.h" -#include "apr_thread_proc.h" -#include "apr_general.h" - - -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - if (TerminateThread(thd->td, APR_SUCCESS) == 0) { - return APR_EEXIST; - } - else { - return APR_SUCCESS; - } -} - -/* Not sure of the best way to do this just yet. -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ - -} - -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ - ap_status_t stat; - if ((stat = pthread_setcanceltype(type, NULL)) == 0) { - return APR_SUCCESS; - } - else { - return stat; - } -} -*/ |