| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Ask each thread to signal its task completion individually when being waited in
wait_on_busy_threads(), and ignore threads that have already finished their
task (elt->current_owner == NULL).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1889217 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Detached threads are out of control and don't give the user a way to
synchronize when the program ends (or when the thread_pool is destroyed).
Rework the synchronization logic so that dead threads are always joined. This
is done by adding dead_thds ring and a join_dead_threads() function called from
several places: on termination when the thread_pool is destroyed, on resizing
with apr_thread_pool_{thread,idle}_max_set() when stopping off limits threads,
on maintenance when a task is added/cancelled.
Since join_dead_threads() waits for threads already dead (not the idle/busy
ones asked to die) the operation is not blocking indefinitely, so there is no
indefinite (nor much) overhead added to these places due to waiting for dead
threads.
The thread_pool_func() worker function is reworked to have a single point of
exit, and to always update the rings and counters accurately according to the
thread state, which allows for simpler maintenance and/or termination from the
other functions. The threads now put themselves into the (new) dead_thds ring
before exit, and the apr_thread_pool_{thread,idle}_max_set() functions don't
modify the idle or busy rings concurrently with the thread_pool_func() workers
anymore. They only ask the threads to stop and put themselves in dead_thds.
To join all the threads in thread_pool_cleanup(), cancel all the tasks and wait
for the busy threads handling them to die/idle (thanks to the new "work_done"
condition variable triggered by the thread after its task), then stop all the
remaining threads by calling apr_thread_pool_thread_max_set(0), and finally
wait for the last thread to exit (thanks to the new "all_done" condition var
triggered by the last thread exiting, replacing the spin wait).
So destroying the thread_pool (or a parent pool) may wait (indefinitely) for
all the active tasks to complete, which is the purpose of this commit: avoid
undefined behaviour in this case.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1884098 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
apu_dso_init() can now be called more than once (from multiple
modules) and from unrelated pools (usually seen in unit tests).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861957 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
(apr_thread_pool_thread_max_set): Use apr_size_t instead of unsigned int to
avoid compiler warning.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860156 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839815 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
populate apu_err_t.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1838375 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834064 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
We can hold the mutex for the whole release time by adding and using an
unlocked reslist_maintain() helper, and ensure more fairness for the releaser.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834061 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Allows to control acquire order, either LIFO (default and current behaviour) or FIFO.
Associated test upcoming...
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834034 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
When a resource is to be acquired, we should check for expiring entries
starting from the oldest to the youngest one, otherwise it's only when
the latter expires that all of the resources are killed in a batch.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834030 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
When ttl=0 is configured, we never need to check for expiry.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834024 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ignore expiry when ttl=0 in apr_reslist_maintain(), like apr_reslist_acquire().
While ttl=0 is supposed to mean no TTL/expiry, apr_reslist_maintain() hence
apr_reslist_release() were destroying all resources above smax in this case.
Corresponding test already committed in r1834022.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834023 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Keep the root pool scope for things that need it only (global lists of drivers
or libs), but otherwise use the passed in pool (crypto libs, default PRNG,
errors).
This allows the caller to control the scope of initialization functions, and
for instance be able to re-initialize when apr_crypto is unloaded/reloaded from
a DSO attached to the passed-in pool (e.g. mod_ssl in httpd).
apu_dso_load() needs to return its handles when called multiple times (EINIT),
it's not the caller's job (like crypto drivers) to maintain them.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833525 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
The doxygen remark wasn't enough as noted by Ruediger.
[Reverted by r1829102]
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828492 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Also, clarify in doxygen when apr_reslist_fifo_set() should be called.
[Reverted by r1829102]
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828369 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
[Reverted by r1829102]
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828367 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
This allows to reuse resources in FIFO mode instead of the default LIFO mode.
[Reverted by r1829102]
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828289 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
support timedout operations. PR 56951.
Signed-off-by: Anthony Minessale <anthm freeswitch.org>
Signed-off-by: Travis Cross <tc traviscross.com>
Reviewed/Modified: ylavic
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667073 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
is a little quieter
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1534882 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
so that we don't go looking in <searchpath>/apr-APR_MAJOR_VERSION
for APU DSOs.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516839 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1479853 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1479836 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
This makes sure that the threads are killed when we start destroying
any sub-pools they may be using.
This is the last missing part to make the test suite run successfully with
full pool debugging enabled.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460185 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
(except in cases where there is no chance that the pool is used)
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460183 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1207680 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
testreslist failures.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1126207 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1064276 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
The use of two mutexes allowed race conditions between
releasing one and acquiring another.
PR: 49709
Submitted by: Joe Mudd <Joe.Mudd sas.com>
Reviewed by: henryjen, trawick
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1002105 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pool
when multiple initial threads are created.
PR: 47843
Submitted by: Alex Korobka <akorobka fxcm.com>
Reviewed by: trawick
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1001685 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
Reported by: clang static analyzer
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982736 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@981753 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892985 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891835 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix overflow in pools and rmm, where size alignment was taking place.
Reported by: Matt Lewis <mattlewis@google.com>
* CHANGES
Add entry for CVE-2009-2412.
* memory/unix/apr_pools.c
(allocator_alloc, apr_palloc): Check for overflow after aligning size.
(apr_pcalloc): Drop aligning of size; clearing what the caller asked for should suffice.
* util-misc/apr_rmm.c
(apr_rmm_malloc, apr_rmm_calloc, apr_rmm_realloc): Check for overflow after aligning size.
Submitted by: Matt Lewis <mattlewis@google.com>, Sander Striker
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@800730 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@794523 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
Patch by Neil Conway <nrc cs.berkeley.edu>.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@784520 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
For 2.0, this is just a temporary solution, until this is re-engineered.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@783580 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--disable-modular-dso:
* configure.in, Makefile.in: Use APR_DSO_MODULES for set of DSOs to
build.
* util-misc/apu_dso.c, include/private/apu_internal.h: Use macro
APR_HAVE_MODULAR_DSO to determine whether modular DSO build is used.
* build/dso.m4 (APR_MODULAR_DSO): Renamed from APU_CHECK_UTIL_DSO.
Define APR_HAVE_MODULAR_DSO if modular DSO biuld is used.
Add to LIBS not APRUTIL_LIBS. Rename configure flag to
--disable-modular-dso to disable modular DSO build.
* ldap/*.c, dbm/*.c, dbd/*.c, crypto/*.c: Adjust to use
APR_HAVE_MODULAR_DSO.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757884 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Use default install prefix of $libdir/apr-$major/
* util-misc/apu_dso.c: Update likewise.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757845 13f79535-47bb-0310-9956-ffa450edef68
|
|
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757704 13f79535-47bb-0310-9956-ffa450edef68
|