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 ma...@apache.org on 2007/10/16 06:22:31 UTC

svn commit: r585030 - /webservices/axis2/trunk/c/src/core/context/op_ctx.c

Author: manjula
Date: Mon Oct 15 21:22:30 2007
New Revision: 585030

URL: http://svn.apache.org/viewvc?rev=585030&view=rev
Log:
Adding ref count to op_ctx.

Modified:
    webservices/axis2/trunk/c/src/core/context/op_ctx.c

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?rev=585030&r1=585029&r2=585030&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/context/op_ctx.c (original)
+++ webservices/axis2/trunk/c/src/core/context/op_ctx.c Mon Oct 15 21:22:30 2007
@@ -60,6 +60,8 @@
     axutil_thread_mutex_t *mutex;
     axis2_bool_t response_written;
     axis2_bool_t is_in_use;
+
+    int ref;
 };
 
 AXIS2_EXTERN axis2_op_ctx_t *AXIS2_CALL
@@ -92,7 +94,7 @@
     op_ctx->response_written = AXIS2_FALSE;
     op_ctx->mutex = axutil_thread_mutex_create(env->allocator,
                                                AXIS2_THREAD_MUTEX_DEFAULT);
-
+    
     if (!op_ctx->mutex)
     {
         axis2_op_ctx_free(op_ctx, env);
@@ -124,6 +126,7 @@
     }
 
     axis2_op_ctx_set_parent(op_ctx, env, svc_ctx);
+    op_ctx->ref = 1;
 
     return op_ctx;
 }
@@ -144,6 +147,11 @@
     int i = 0;
     AXIS2_ENV_CHECK(env, void);
 
+    if (--(op_ctx->ref) > 0)
+    {
+        return;
+    }
+
     if (op_ctx->base)
     {
         axis2_ctx_free(op_ctx->base, env);
@@ -413,3 +421,15 @@
 
     return AXIS2_SUCCESS;
 }
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axis2_op_ctx_increment_ref(
+    axis2_op_ctx_t * op_ctx,
+    const axutil_env_t * env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    op_ctx->ref++;
+    return AXIS2_SUCCESS;
+}
+



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