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

Function vhost_user_reconnect_init

dpdk/lib/vhost/socket.c:503–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501}
502
503static int
504vhost_user_reconnect_init(void)
505{
506 int ret;
507
508 ret = pthread_mutex_init(&reconn_list.mutex, NULL);
509 if (ret < 0) {
510 VHOST_LOG_CONFIG("thread", ERR, "%s: failed to initialize mutex\n", __func__);
511 return ret;
512 }
513 TAILQ_INIT(&reconn_list.head);
514
515 ret = rte_thread_create_internal_control(&reconn_tid, "vhost-reco",
516 vhost_user_client_reconnect, NULL);
517 if (ret != 0) {
518 VHOST_LOG_CONFIG("thread", ERR, "failed to create reconnect thread\n");
519 if (pthread_mutex_destroy(&reconn_list.mutex))
520 VHOST_LOG_CONFIG("thread", ERR,
521 "%s: failed to destroy reconnect mutex\n",
522 __func__);
523 }
524
525 return ret;
526}
527
528static int
529vhost_user_start_client(struct vhost_user_socket *vsocket)

Callers 1

Calls 3

pthread_mutex_initFunction · 0.85
pthread_mutex_destroyFunction · 0.85

Tested by

no test coverage detected