CNO events, once triggered will not be returned during the cno wait.
Check for triggered state before going to sleep in cno_wait. Reset
triggered EVD reference after reporting.

diff --git a/dapl/udapl/dapl_cno_wait.c b/dapl/udapl/dapl_cno_wait.c
index e89317d..6bbd249 100644
--- a/dapl/udapl/dapl_cno_wait.c
+++ b/dapl/udapl/dapl_cno_wait.c
@@ -82,6 +82,14 @@ DAT_RETURN DAT_API dapl_cno_wait(IN DAT_CNO_HANDLE 
cno_handle,       /* cno_handle */
        }
 
        dapl_os_lock(&cno_ptr->header.lock);
+       if (cno_ptr->cno_state == DAPL_CNO_STATE_TRIGGERED) {
+               cno_ptr->cno_state = DAPL_CNO_STATE_UNTRIGGERED;
+               *evd_handle = cno_ptr->cno_evd_triggered;
+               cno_ptr->cno_evd_triggered = NULL;
+               dapl_os_unlock(&cno_ptr->header.lock);
+               goto bail;
+       }
+
        while (cno_ptr->cno_state == DAPL_CNO_STATE_UNTRIGGERED
               && DAT_GET_TYPE(dat_status) != DAT_TIMEOUT_EXPIRED) {
                cno_ptr->cno_waiters++;
@@ -104,6 +112,7 @@ DAT_RETURN DAT_API dapl_cno_wait(IN DAT_CNO_HANDLE 
cno_handle,      /* cno_handle */
                dapl_os_assert(cno_ptr->cno_state == DAPL_CNO_STATE_TRIGGERED);
                cno_ptr->cno_state = DAPL_CNO_STATE_UNTRIGGERED;
                *evd_handle = cno_ptr->cno_evd_triggered;
+               cno_ptr->cno_evd_triggered = NULL;
        } else if (DAT_GET_TYPE(dat_status) == DAT_TIMEOUT_EXPIRED) {
                cno_ptr->cno_state = DAPL_CNO_STATE_UNTRIGGERED;
                *evd_handle = NULL;

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to