MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vhost_user_remove_reconnect

Function vhost_user_remove_reconnect

dpdk/lib/vhost/socket.c:1049–1071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047}
1048
1049static bool
1050vhost_user_remove_reconnect(struct vhost_user_socket *vsocket)
1051{
1052 int found = false;
1053 struct vhost_user_reconnect *reconn, *next;
1054
1055 pthread_mutex_lock(&reconn_list.mutex);
1056
1057 for (reconn = TAILQ_FIRST(&reconn_list.head);
1058 reconn != NULL; reconn = next) {
1059 next = TAILQ_NEXT(reconn, next);
1060
1061 if (reconn->vsocket == vsocket) {
1062 TAILQ_REMOVE(&reconn_list.head, reconn, next);
1063 close(reconn->fd);
1064 free(reconn);
1065 found = true;
1066 break;
1067 }
1068 }
1069 pthread_mutex_unlock(&reconn_list.mutex);
1070 return found;
1071}
1072
1073/**
1074 * Unregister the specified vhost socket

Callers 1

Calls 4

pthread_mutex_lockFunction · 0.85
pthread_mutex_unlockFunction · 0.85
closeFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected