X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fthread-utils.c;h=16ae9d69204a971b07ac6d2857a148df87d983bd;hp=3a8ddb3303639f75d86be3e1b7da7a232d2771ec;hb=81684730b3134c61ca310bf26733c01d783103d7;hpb=99d688f2849a22589351cf353edce0c756cddb74 diff --git a/src/bin/lttng-sessiond/thread-utils.c b/src/bin/lttng-sessiond/thread-utils.c index 3a8ddb330..16ae9d692 100644 --- a/src/bin/lttng-sessiond/thread-utils.c +++ b/src/bin/lttng-sessiond/thread-utils.c @@ -22,27 +22,12 @@ #include #include -#define USEC_PER_SEC 1000000 - /* * Quit pipe for all threads. This permits a single cancellation point * for all threads when receiving an event on the pipe. */ static int thread_quit_pipe[2] = { -1, -1 }; -/* - * Allows threads to query the state of the client thread. - */ -static struct client_thread_state { - pthread_cond_t cond; - pthread_mutex_t lock; - bool is_running; -} client_thread_state = { - .cond = PTHREAD_COND_INITIALIZER, - .lock = PTHREAD_MUTEX_INITIALIZER, - .is_running = false -}; - /* * Init thread quit pipe. * @@ -136,24 +121,6 @@ void sessiond_close_quit_pipe(void) utils_close_pipe(thread_quit_pipe); } -void sessiond_set_client_thread_state(bool running) -{ - pthread_mutex_lock(&client_thread_state.lock); - client_thread_state.is_running = running; - pthread_cond_broadcast(&client_thread_state.cond); - pthread_mutex_unlock(&client_thread_state.lock); -} - -void sessiond_wait_client_thread_stopped(void) -{ - pthread_mutex_lock(&client_thread_state.lock); - while (client_thread_state.is_running) { - pthread_cond_wait(&client_thread_state.cond, - &client_thread_state.lock); - } - pthread_mutex_unlock(&client_thread_state.lock); -} - static int __sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size, int *a_pipe)