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 da...@apache.org on 2007/04/26 10:08:38 UTC

svn commit: r532648 - in /webservices/axis2/trunk/c: include/axis2_op_ctx.h src/core/context/op_ctx.c src/core/transport/http/common/http_worker.c

Author: damitha
Date: Thu Apr 26 01:08:37 2007
New Revision: 532648

URL: http://svn.apache.org/viewvc?view=rev&rev=532648
Log:
Added is_in_use attribute to the op_ctx.
This is necessary when destroying the thread mutex at the http_worker to 
check whether the operation context is still in use

Modified:
    webservices/axis2/trunk/c/include/axis2_op_ctx.h
    webservices/axis2/trunk/c/src/core/context/op_ctx.c
    webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c

Modified: webservices/axis2/trunk/c/include/axis2_op_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_op_ctx.h?view=diff&rev=532648&r1=532647&r2=532648
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_op_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_op_ctx.h Thu Apr 26 01:08:37 2007
@@ -234,6 +234,33 @@
         struct axis2_op_ctx *op_ctx,
         const axutil_env_t *env);
 
+    /**
+     * Checks whether op_ctx is in use. This is necessary when destroying the
+     * thread mutex at the http_worker to check whether the operation context
+     * is still in use
+     * @param msg_ctx message context
+     * @param env pointer to environment struct
+     * @return AXIS2_TRUE if still in use, else AXIS2_FALSE         
+     */
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+    axis2_op_ctx_is_in_use(
+        const axis2_op_ctx_t *op_ctx,
+        const axutil_env_t *env);
+
+    /**
+     * Set operation context's is_in_use attribute. This is necessary when 
+     * destroying the thread mutex at the http_worker to check whether the 
+     * operation context is still in use
+     * @param msg_ctx message context
+     * @param env pointer to environment struct
+     * @return AXIS2_TRUE if still in use, else AXIS2_FALSE         
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_op_ctx_set_in_use(
+        struct axis2_op_ctx *op_ctx,
+        const axutil_env_t *env,
+        axis2_bool_t is_in_use);
+
 
 #ifdef __cplusplus
 }

Modified: webservices/axis2/trunk/c/src/core/context/op_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/context/op_ctx.c?view=diff&rev=532648&r1=532647&r2=532648
==============================================================================
--- webservices/axis2/trunk/c/src/core/context/op_ctx.c (original)
+++ webservices/axis2/trunk/c/src/core/context/op_ctx.c Thu Apr 26 01:08:37 2007
@@ -49,6 +49,7 @@
     /* mutex to synchronize the read/write operations */
     axutil_thread_mutex_t *mutex;
     axis2_bool_t response_written;
+    axis2_bool_t is_in_use;
 };
 
 AXIS2_EXTERN axis2_op_ctx_t *AXIS2_CALL
@@ -73,6 +74,7 @@
     op_ctx->op = NULL;
     op_ctx->op_mep = 0;
     op_ctx->is_complete = AXIS2_FALSE;
+    op_ctx->is_in_use = AXIS2_FALSE;
     op_ctx->op_ctx_map = NULL;
     op_ctx->op_qname = NULL;
     op_ctx->svc_qname = NULL;
@@ -291,6 +293,24 @@
     axis2_bool_t is_complete)
 {
     op_ctx->is_complete = is_complete;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+axis2_op_ctx_is_in_use(
+    const axis2_op_ctx_t *op_ctx,
+    const axutil_env_t *env)
+{
+    return op_ctx->is_in_use;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axis2_op_ctx_set_in_use(
+    struct axis2_op_ctx *op_ctx,
+    const axutil_env_t *env,
+    axis2_bool_t is_in_use)
+{
+    op_ctx->is_in_use = is_in_use;
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c?view=diff&rev=532648&r1=532647&r2=532648
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c Thu Apr 26 01:08:37 2007
@@ -395,8 +395,8 @@
         axis2_msg_ctx_t **msg_ctx_map = NULL;
         
         msg_ctx_map =  axis2_op_ctx_get_msg_ctx_map(op_ctx, env);
-
-        axis2_op_ctx_destroy_mutex(op_ctx, env);
+        if(!axis2_op_ctx_is_in_use(op_ctx, env))
+            axis2_op_ctx_destroy_mutex(op_ctx, env);
 
         out_msg_ctx = msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_OUT];
         in_msg_ctx = msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_IN];



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org