X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=liblttkconsumerd%2Fliblttkconsumerd.c;h=25e00132538781d15f1b350f668883d01e67e24f;hb=e6ddca715d6dedb6ee25fe4392a6e1f9626b2544;hp=de942a1983182df755938bfe1b840c3262a22215;hpb=3dcd27214e19ba1175a7ac4057d3ce2c7b99c599;p=lttng-tools.git diff --git a/liblttkconsumerd/liblttkconsumerd.c b/liblttkconsumerd/liblttkconsumerd.c index de942a198..25e001325 100644 --- a/liblttkconsumerd/liblttkconsumerd.c +++ b/liblttkconsumerd/liblttkconsumerd.c @@ -61,6 +61,7 @@ struct kconsumerd_global_data { unsigned int need_update; } kconsumerd_data = { .fd_list.head = CDS_LIST_HEAD_INIT(kconsumerd_data.fd_list.head), + .need_update = 1, }; /* communication with splice */ @@ -75,6 +76,7 @@ static int kconsumerd_poll_pipe[2]; * received by the library. */ + /* timeout parameter, to control the polling thread grace period */ static int kconsumerd_poll_timeout = -1; @@ -116,6 +118,7 @@ void kconsumerd_set_command_socket_path(char *sock) * kconsumerd_find_session_fd * * Find a session fd in the global list. + * The kconsumerd_data.lock must be locked during this call * * Return 1 if found else 0 */ @@ -123,7 +126,6 @@ static int kconsumerd_find_session_fd(int fd) { struct kconsumerd_fd *iter; - pthread_mutex_lock(&kconsumerd_data.lock); cds_list_for_each_entry(iter, &kconsumerd_data.fd_list.head, list) { if (iter->sessiond_fd == fd) { DBG("Duplicate session fd %d", fd); @@ -131,7 +133,6 @@ static int kconsumerd_find_session_fd(int fd) return 1; } } - pthread_mutex_unlock(&kconsumerd_data.lock); return 0; }