You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/02/13 12:11:28 UTC

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

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 <axis2_dir_handler.h>
 #include <axis2_file.h>
 #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;	
 }