~ubuntu-branches/ubuntu/saucy/apache2/saucy

« back to all changes in this revision

Viewing changes to srclib/apr-util/misc/apr_thread_pool.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-02-12 20:06:35 UTC
  • mfrom: (14.3.34 sid)
  • Revision ID: package-import@ubuntu.com-20120212200635-2u9d58jxqkmx91na
Tags: 2.2.22-1ubuntu1
* Merge from Debian testing.  Remaining changes:
  - debian/{control, rules}: Enable PIE hardening.
  - debian/{control, rules, apache2.2-common.ufw.profile}: Add ufw profiles.
  - debian/control: Add bzr tag and point it to our tree
  - debian/apache2.py, debian/apache2.2-common.install: Add apport hook.
  - debian/control, debian/ask-for-passphrase, debian/config-dir/mods-available/ssl.conf:
    Plymouth aware passphrase dialog program ask-for-passphrase.

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
 */
238
238
static void *APR_THREAD_FUNC thread_pool_func(apr_thread_t * t, void *param)
239
239
{
240
 
    apr_status_t rv = APR_SUCCESS;
241
240
    apr_thread_pool_t *me = param;
242
241
    apr_thread_pool_task_t *task = NULL;
243
242
    apr_interval_time_t wait;
313
312
            wait = -1;
314
313
 
315
314
        if (wait >= 0) {
316
 
            rv = apr_thread_cond_timedwait(me->cond, me->lock, wait);
 
315
            apr_thread_cond_timedwait(me->cond, me->lock, wait);
317
316
        }
318
317
        else {
319
 
            rv = apr_thread_cond_wait(me->cond, me->lock);
 
318
            apr_thread_cond_wait(me->cond, me->lock);
320
319
        }
321
320
    }
322
321
 
353
352
    *me = NULL;
354
353
    tp = apr_pcalloc(pool, sizeof(apr_thread_pool_t));
355
354
 
356
 
    tp->pool = pool;
357
 
 
 
355
    /*
 
356
     * This pool will be used by different threads. As we cannot ensure that
 
357
     * our caller won't use the pool without acquiring the mutex, we must
 
358
     * create a new sub pool.
 
359
     */
 
360
    rv = apr_pool_create(&tp->pool, pool);
 
361
    if (APR_SUCCESS != rv)
 
362
        return rv;
358
363
    rv = thread_pool_construct(tp, init_threads, max_threads);
359
 
    if (APR_SUCCESS != rv) {
 
364
    if (APR_SUCCESS != rv)
360
365
        return rv;
361
 
    }
362
 
    apr_pool_cleanup_register(pool, tp, thread_pool_cleanup,
 
366
    apr_pool_cleanup_register(tp->pool, tp, thread_pool_cleanup,
363
367
                              apr_pool_cleanup_null);
364
368
 
365
369
    while (init_threads) {