1
1

Merge pull request #1784 from thananon/fix_usnic_thread

Fix btl/usnic deadlock when the connectivity check is turned off.
Этот коммит содержится в:
Jeff Squyres 2016-06-17 11:15:14 -04:00 коммит произвёл GitHub
родитель f59c2fce6b 7bd18214a7
Коммит c332ee5884

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

@ -229,12 +229,14 @@ int opal_btl_usnic_connectivity_ping(uint32_t src_ipv4_addr, int src_port,
char *dest_nodename,
size_t max_msg_size)
{
OPAL_THREAD_LOCK(&btl_usnic_lock);
/* If connectivity checking is not enabled, do nothing */
if (!mca_btl_usnic_component.connectivity_enabled) {
return OPAL_SUCCESS;
}
/* Protect opal_fd_write for multithreaded case */
OPAL_THREAD_LOCK(&btl_usnic_lock);
/* Send the PING command */
int id = CONNECTIVITY_AGENT_CMD_PING;
if (OPAL_SUCCESS != opal_fd_write(agent_fd, sizeof(id), &id)) {
@ -260,6 +262,8 @@ int opal_btl_usnic_connectivity_ping(uint32_t src_ipv4_addr, int src_port,
ABORT("usnic connectivity client IPC write failed");
/* Will not return */
}
/* Unlock and return */
OPAL_THREAD_UNLOCK(&btl_usnic_lock);
return OPAL_SUCCESS;