Fix locking dependency problem
authorJulien Desfossez <julien.desfossez@polymtl.ca>
Fri, 15 Jul 2011 19:05:00 +0000 (15:05 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Fri, 15 Jul 2011 20:12:03 +0000 (16:12 -0400)
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
liblttkconsumerd/liblttkconsumerd.c

index de942a1983182df755938bfe1b840c3262a22215..4ec949e0f2c18ad771f6ad3e30151e4a0af28bf2 100644 (file)
@@ -75,6 +75,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 +117,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 +125,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 +132,6 @@ static int kconsumerd_find_session_fd(int fd)
                        return 1;
                }
        }
-       pthread_mutex_unlock(&kconsumerd_data.lock);
 
        return 0;
 }
This page took 0.033666 seconds and 4 git commands to generate.