[PVFS2-CVS] commit by neill in pvfs2/src/io/flow: flow.c

CVS commit program cvs at parl.clemson.edu
Thu Jul 8 13:17:10 EDT 2004


Update of /projects/cvsroot/pvfs2/src/io/flow
In directory parlweb:/tmp/cvs-serv12211/src/io/flow

Modified Files:
	flow.c 
Log Message:
- merging in the pvfs2-nm-nb-branch with the main tree
  see ChangeLog for details, or browse the cvs history of the branch
  for full details


Index: flow.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/flow/flow.c,v
diff -p -u -r1.40 -r1.41
--- flow.c	27 Apr 2004 22:37:53 -0000	1.40
+++ flow.c	8 Jul 2004 16:17:10 -0000	1.41
@@ -299,6 +299,7 @@ flow_descriptor *PINT_flow_alloc(void)
  */
 void PINT_flow_reset(flow_descriptor * flow_d)
 {
+    assert(flow_d);
 
     memset(flow_d, 0, sizeof(struct flow_descriptor));
 
@@ -306,10 +307,11 @@ void PINT_flow_reset(flow_descriptor * f
     flow_d->aggregate_size = -1;
     flow_d->state = FLOW_INITIAL;
     flow_d->type = FLOWPROTO_DEFAULT;
-    flow_d->flow_mutex = gen_mutex_build();
+    if (flow_d->flow_mutex == NULL)
+    {
+        flow_d->flow_mutex = gen_mutex_build();
+    }
     assert(flow_d->flow_mutex);
-
-    return;
 }
 
 /* PINT_flow_free()
@@ -320,7 +322,11 @@ void PINT_flow_reset(flow_descriptor * f
  */
 void PINT_flow_free(flow_descriptor *flow_d)
 {
+    assert(flow_d);
+    assert(flow_d->flow_mutex);
+
     gen_mutex_destroy(flow_d->flow_mutex);
+    flow_d->flow_mutex = NULL;
 
     free(flow_d);
     return;



More information about the PVFS2-CVS mailing list