Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2E49310C4C for ; Tue, 21 Jan 2014 11:25:30 +0000 (UTC) Received: (qmail 65368 invoked by uid 500); 21 Jan 2014 11:25:29 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 65276 invoked by uid 500); 21 Jan 2014 11:25:28 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 65269 invoked by uid 99); 21 Jan 2014 11:25:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jan 2014 11:25:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jan 2014 11:25:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 93B2F23889DA; Tue, 21 Jan 2014 11:25:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1559977 - in /apr/apr/branches/1.4.x: ./ test/testdir.c Date: Tue, 21 Jan 2014 11:25:06 -0000 To: commits@apr.apache.org From: brane@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140121112506.93B2F23889DA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: brane Date: Tue Jan 21 11:25:06 2014 New Revision: 1559977 URL: http://svn.apache.org/r1559977 Log: Merged r1559975 from trunk: Give every thread in the parallel recursive mkdir test its own pool to play with, to prevent weird data interdependencies. * test/testdir.c (struct thread_data): Encapsulates abts_case and per-thread pool. (thread_mkdir_func): Thread data is thread_data, not abts_case. (test_mkdir_recurs_parallel): Create a separate pool and thread data struct for each thread. Modified: apr/apr/branches/1.4.x/ (props changed) apr/apr/branches/1.4.x/test/testdir.c Propchange: apr/apr/branches/1.4.x/ ------------------------------------------------------------------------------ Merged /apr/apr/trunk:r1559975 Modified: apr/apr/branches/1.4.x/test/testdir.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/test/testdir.c?rev=1559977&r1=1559976&r2=1559977&view=diff ============================================================================== --- apr/apr/branches/1.4.x/test/testdir.c (original) +++ apr/apr/branches/1.4.x/test/testdir.c Tue Jan 21 11:25:06 2014 @@ -60,47 +60,60 @@ static void test_mkdir_recurs(abts_case ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); } +struct thread_data +{ + abts_case *tc; + apr_pool_t *pool; +}; + static void *APR_THREAD_FUNC thread_mkdir_func(apr_thread_t *thd, void *data) { - abts_case *tc = data; + struct thread_data *td = data; apr_status_t s1, s2, s3, s4, s5; s1 = apr_dir_make_recursive("data/prll/one/thwo/three", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); s2 = apr_dir_make_recursive("data/prll/four/five/six/seven/eight", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); s3 = apr_dir_make_recursive("data/prll/nine/ten", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); s4 = apr_dir_make_recursive("data/prll/11/12/13/14/15/16/17/18/19/20", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); s5 = apr_dir_make_recursive("data/fortytwo", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s5); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s1); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s2); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s3); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s4); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s5); return NULL; } static void test_mkdir_recurs_parallel(abts_case *tc, void *data) { + struct thread_data td1, td2, td3, td4; apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; - s1 = apr_thread_create(&t1, NULL, thread_mkdir_func, tc, p); + td1.tc = td2.tc = td3.tc = td4.tc = tc; + apr_pool_create(&td1.pool, p); + apr_pool_create(&td2.pool, p); + apr_pool_create(&td3.pool, p); + apr_pool_create(&td4.pool, p); + + s1 = apr_thread_create(&t1, NULL, thread_mkdir_func, &td1, td1.pool); ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); - s2 = apr_thread_create(&t2, NULL, thread_mkdir_func, tc, p); + s2 = apr_thread_create(&t2, NULL, thread_mkdir_func, &td2, td2.pool); ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); - s3 = apr_thread_create(&t3, NULL, thread_mkdir_func, tc, p); + s3 = apr_thread_create(&t3, NULL, thread_mkdir_func, &td3, td3.pool); ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); - s4 = apr_thread_create(&t4, NULL, thread_mkdir_func, tc, p); + s4 = apr_thread_create(&t4, NULL, thread_mkdir_func, &td4, td4.pool); ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); apr_thread_join(&s1, t1);