summaryrefslogtreecommitdiff
path: root/util-misc
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-04-13 21:02:00 +0000
committerYann Ylavic <ylavic@apache.org>2018-04-13 21:02:00 +0000
commit2d9c71b73b71c85a8be13d2dd0bc3f9cde18b889 (patch)
tree5aadd24672bd4a2fa7f94ff3c657e8e0dba0b3b5 /util-misc
parenta0e6296305b3a7adac99c2155d7dbc841c45788a (diff)
downloadapr-2d9c71b73b71c85a8be13d2dd0bc3f9cde18b889.tar.gz
Revert apr_reslist_fifo_set() (r1828289 and follow ups).
Will re-implement the feature through apr_reslist_acquire_fifo(), as proposed by Bill. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1829102 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'util-misc')
-rw-r--r--util-misc/apr_reslist.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c
index 6e477110f..ecc17a7d4 100644
--- a/util-misc/apr_reslist.c
+++ b/util-misc/apr_reslist.c
@@ -58,7 +58,6 @@ struct apr_reslist_t {
apr_thread_mutex_t *listlock;
apr_thread_cond_t *avail;
#endif
- int fifo;
};
/**
@@ -81,12 +80,7 @@ static apr_res_t *pop_resource(apr_reslist_t *reslist)
*/
static void push_resource(apr_reslist_t *reslist, apr_res_t *resource)
{
- if (reslist->fifo) {
- APR_RING_INSERT_TAIL(&reslist->avail_list, resource, apr_res_t, link);
- }
- else {
- APR_RING_INSERT_HEAD(&reslist->avail_list, resource, apr_res_t, link);
- }
+ APR_RING_INSERT_HEAD(&reslist->avail_list, resource, apr_res_t, link);
resource->freed = apr_time_now();
reslist->nidle++;
}
@@ -229,13 +223,8 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist)
/* Check if we need to expire old resources */
now = apr_time_now();
while (reslist->nidle > reslist->smax && reslist->nidle > 0) {
- /* Peek at the next expiring resource in the list */
- if (reslist->fifo) {
- res = APR_RING_FIRST(&reslist->avail_list);
- }
- else {
- res = APR_RING_LAST(&reslist->avail_list);
- }
+ /* Peak at the last resource in the list */
+ res = APR_RING_LAST(&reslist->avail_list);
/* See if the oldest entry should be expired */
if (now - res->freed < reslist->ttl) {
/* If this entry is too young, none of the others
@@ -445,17 +434,6 @@ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist,
reslist->timeout = timeout;
}
-APR_DECLARE(apr_status_t) apr_reslist_fifo_set(apr_reslist_t *reslist,
- int fifo)
-{
- if (!APR_RING_EMPTY(&reslist->avail_list, apr_res_t, link)) {
- return APR_EBUSY;
- }
-
- reslist->fifo = fifo;
- return APR_SUCCESS;
-}
-
APR_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist)
{
apr_uint32_t count;