[Pvfs2-cvs] commit by slang in pvfs2/src/io/bmi/bmi_mx: mx.c
CVS commit program
cvs at parl.clemson.edu
Wed Jul 18 03:02:32 EDT 2007
Update of /projects/cvsroot/pvfs2/src/io/bmi/bmi_mx
In directory parlweb1:/tmp/cvs-serv4881/src/io/bmi/bmi_mx
Modified Files:
mx.c
Log Message:
mx fixes
Index: mx.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_mx/mx.c,v
diff -p -u -r1.1 -r1.2
--- mx.c 13 Feb 2007 18:39:39 -0000 1.1
+++ mx.c 18 Jul 2007 07:02:32 -0000 1.2
@@ -2300,6 +2300,7 @@ BMI_mx_testcontext(int incount, bmi_op_i
struct bmx_ctx *ctx = NULL;
struct bmx_peer *peer = NULL;
list_t *canceled = &bmi_mx->bmx_canceled;
+ int wait = 0;
bmx_connection_handlers();
@@ -2336,7 +2337,17 @@ BMI_mx_testcontext(int incount, bmi_op_i
uint32_t result = 0;
mx_status_t status;
- mx_test_any(bmi_mx->bmx_ep, match, mask, &status, &result);
+ if(wait == 0 || wait == 2)
+ {
+ mx_test_any(bmi_mx->bmx_ep, match, mask, &status, &result);
+ if(!result && wait == 0) wait = 1;
+ }
+ else if(wait == 1 && max_idle_time > 0)
+ {
+ mx_wait_any(bmi_mx->bmx_ep, max_idle_time, match, mask, &status, &result);
+ wait = 2;
+ }
+
if (result) {
ctx = (struct bmx_ctx *) status.context;
peer = ctx->mxc_peer;
@@ -2382,11 +2393,22 @@ BMI_mx_testcontext(int incount, bmi_op_i
* we will always try (incount - completed) times even
* if some iterations have no result */
match = (uint64_t) BMX_MSG_EXPECTED << 60;
+ wait = 0;
for (i = completed; i < incount; i++) {
uint32_t result = 0;
mx_status_t status;
- mx_test_any(bmi_mx->bmx_ep, match, mask, &status, &result);
+ if(wait == 0 || wait == 2)
+ {
+ mx_test_any(bmi_mx->bmx_ep, match, mask, &status, &result);
+ if(!result && wait == 0) wait = 1;
+ }
+ else if(wait == 1 && max_idle_time > 0)
+ {
+ mx_wait_any(bmi_mx->bmx_ep, max_idle_time, match, mask, &status, &result);
+ wait = 2;
+ }
+
if (result) {
ctx = (struct bmx_ctx *) status.context;
peer = ctx->mxc_peer;
More information about the Pvfs2-cvs
mailing list