[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1182984 - /subversion/trunk/subversion/tests/libsvn_subr/cache-test.c

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 13 Oct 2011 18:15:43 +0100

stefan2_at_apache.org writes:

> Author: stefan2
> Date: Thu Oct 13 17:01:27 2011
> New Revision: 1182984
>
> URL: http://svn.apache.org/viewvc?rev=1182984&view=rev
> Log:
> Simplify the code by using APR_HAS_THREADS directly as a parameter
> instead of setting a thread_safe intermediate.
>
> * subversion/tests/libsvn_subr/cache-test.c
> (test_membuffer_cache_basic): simplify
>
> Modified:
> subversion/trunk/subversion/tests/libsvn_subr/cache-test.c
>
> Modified: subversion/trunk/subversion/tests/libsvn_subr/cache-test.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/cache-test.c?rev=1182984&r1=1182983&r2=1182984&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/libsvn_subr/cache-test.c (original)
> +++ subversion/trunk/subversion/tests/libsvn_subr/cache-test.c Thu Oct 13 17:01:27 2011
> @@ -182,16 +182,9 @@ test_membuffer_cache_basic(apr_pool_t *p
> {
> svn_cache__t *cache;
> svn_membuffer_t *membuffer;
> - svn_boolean_t thread_safe;
> -
> -#if APR_HAS_THREADS
> - thread_safe = TRUE;
> -#else
> - thread_safe = FALSE;
> -#endif
>
> SVN_ERR(svn_cache__membuffer_cache_create(&membuffer, 10*1024, 1,
> - thread_safe, pool));
> + APR_HAS_THREADS, pool));

Dangerous. What are the valid values for APR_HAS_THREADS? When
threading is present it uses something like:

#define APR_HAS_THREADS 1

but when threading is not present it may simply not define
APR_HAS_THREADS at all.

-- 
Philip
Received on 2011-10-13 19:16:22 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.