1
1

Modified the MCA_BTL_TCP_CONNECTED case in mca_btl_tcp_endpoint_send_handler()

to always first check for a NULL frag pointer before trying to send the
fragment.  This avoids an issue in multi-threaded execution in which 
multiple threads working on the same endpoint can result in a thread 
finding itself here with nothing to send.

This commit was SVN r15963.
Этот коммит содержится в:
Brad Benton 2007-08-26 23:40:02 +00:00
родитель 475073c684
Коммит ccda5c9c74

Просмотреть файл

@ -723,7 +723,7 @@ static void mca_btl_tcp_endpoint_send_handler(int sd, short flags, void* user)
break; break;
case MCA_BTL_TCP_CONNECTED: case MCA_BTL_TCP_CONNECTED:
/* complete the current send */ /* complete the current send */
do { while (NULL != btl_endpoint->endpoint_send_frag) {
mca_btl_tcp_frag_t* frag = btl_endpoint->endpoint_send_frag; mca_btl_tcp_frag_t* frag = btl_endpoint->endpoint_send_frag;
if(mca_btl_tcp_frag_send(frag, btl_endpoint->endpoint_sd) == false) { if(mca_btl_tcp_frag_send(frag, btl_endpoint->endpoint_sd) == false) {
break; break;
@ -737,7 +737,7 @@ static void mca_btl_tcp_endpoint_send_handler(int sd, short flags, void* user)
frag->base.des_cbfunc(&frag->btl->super, frag->endpoint, &frag->base, frag->rc); frag->base.des_cbfunc(&frag->btl->super, frag->endpoint, &frag->base, frag->rc);
OPAL_THREAD_LOCK(&btl_endpoint->endpoint_send_lock); OPAL_THREAD_LOCK(&btl_endpoint->endpoint_send_lock);
} while (NULL != btl_endpoint->endpoint_send_frag); }
/* if nothing else to do unregister for send event notifications */ /* if nothing else to do unregister for send event notifications */
if(NULL == btl_endpoint->endpoint_send_frag) { if(NULL == btl_endpoint->endpoint_send_frag) {