Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 91233 invoked from network); 13 Feb 2006 11:11:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Feb 2006 11:11:55 -0000 Received: (qmail 70119 invoked by uid 500); 13 Feb 2006 11:11:53 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 69930 invoked by uid 500); 13 Feb 2006 11:11:51 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 69919 invoked by uid 500); 13 Feb 2006 11:11:51 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 69911 invoked by uid 99); 13 Feb 2006 11:11:51 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2006 03:11:51 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 13 Feb 2006 03:11:50 -0800 Received: (qmail 90959 invoked by uid 65534); 13 Feb 2006 11:11:30 -0000 Message-ID: <20060213111130.90954.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r377343 - in /webservices/axis2/trunk/c: include/axis2_thread.h modules/platforms/unix/thread_unix.c test/util/test_thread.c test/util/test_util.c Date: Mon, 13 Feb 2006 11:11:28 -0000 To: axis2-cvs@ws.apache.org From: sahan@apache.org X-Mailer: svnmailer-1.0.6 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sahan Date: Mon Feb 13 03:11:25 2006 New Revision: 377343 URL: http://svn.apache.org/viewcvs?rev=377343&view=rev Log: Added thread tests. Change the format of the thread_once_init Modified: webservices/axis2/trunk/c/include/axis2_thread.h webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c webservices/axis2/trunk/c/test/util/test_thread.c webservices/axis2/trunk/c/test/util/test_util.c Modified: webservices/axis2/trunk/c/include/axis2_thread.h URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_thread.h?rev=377343&r1=377342&r2=377343&view=diff ============================================================================== --- webservices/axis2/trunk/c/include/axis2_thread.h (original) +++ webservices/axis2/trunk/c/include/axis2_thread.h Mon Feb 13 03:11:25 2006 @@ -130,9 +130,8 @@ * @param control The control variable to initialize * @return The status of the operation */ -AXIS2_DECLARE(axis2_status_t) -axis2_thread_once_init(axis2_thread_once_t **control, - axis2_allocator_t *allocator); +AXIS2_DECLARE(axis2_thread_once_t*) +axis2_thread_once_init(axis2_allocator_t *allocator); /** * Run the specified function one time, regardless of how many threads Modified: webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c?rev=377343&r1=377342&r2=377343&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c (original) +++ webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c Mon Feb 13 03:11:25 2006 @@ -178,18 +178,18 @@ return thd->td; } -AXIS2_DECLARE(axis2_status_t) -axis2_thread_once_init(axis2_thread_once_t **control, - axis2_allocator_t* allocator) +AXIS2_DECLARE(axis2_thread_once_t*) +axis2_thread_once_init(axis2_allocator_t* allocator) { static const pthread_once_t once_init = PTHREAD_ONCE_INIT; - *control = AXIS2_MALLOC(allocator, sizeof(**control)); - if(NULL == *control) + axis2_thread_once_t *control = AXIS2_MALLOC(allocator, + sizeof(axis2_thread_once_t)); + if(NULL == control) { - return AXIS2_FAILURE; + return NULL;; } - (*control)->once = once_init; - return AXIS2_SUCCESS; + (control)->once = once_init; + return control; } AXIS2_DECLARE(axis2_status_t) Modified: webservices/axis2/trunk/c/test/util/test_thread.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/util/test_thread.c?rev=377343&r1=377342&r2=377343&view=diff ============================================================================== --- webservices/axis2/trunk/c/test/util/test_thread.c (original) +++ webservices/axis2/trunk/c/test/util/test_thread.c Mon Feb 13 03:11:25 2006 @@ -49,7 +49,7 @@ allocator = env->allocator; - rv = axis2_thread_once_init(&control, allocator); + control = axis2_thread_once_init(allocator); if (AXIS2_SUCCESS == rv) printf("success - thread_init - axis2_thread_once_init \n"); else printf("failure - thread_init - axis2_thread_once_init \n"); Modified: webservices/axis2/trunk/c/test/util/test_util.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/util/test_util.c?rev=377343&r1=377342&r2=377343&view=diff ============================================================================== --- webservices/axis2/trunk/c/test/util/test_util.c (original) +++ webservices/axis2/trunk/c/test/util/test_util.c Mon Feb 13 03:11:25 2006 @@ -28,6 +28,7 @@ #include #include #include "axis2_log.h" +#include "test_thread.h" typedef struct a { @@ -293,5 +294,6 @@ test_uuid_gen(env); run_test_log(); test_axis2_dir_handler_list_service_or_module_dirs(); + run_test_thread(env); return 0; }