static struct lttng_uri *live_uri;
-/*
- * Quit pipe for all threads. This permits a single cancellation point
- * for all threads when receiving an event on the pipe.
- */
-static int live_thread_quit_pipe[2] = { -1, -1 };
-
/*
* This pipe is used to inform the worker thread that a command is queued and
* ready to be processed.
/* Stopping all threads */
DBG("Terminating all live threads");
- ret = notify_thread_pipe(live_thread_quit_pipe[1]);
+ ret = notify_thread_pipe(thread_quit_pipe[1]);
if (ret < 0) {
ERR("write error on thread quit pipe");
}
}
/* Add quit pipe */
- ret = lttng_poll_add(events, live_thread_quit_pipe[0], LPOLLIN | LPOLLERR);
+ ret = lttng_poll_add(events, thread_quit_pipe[0], LPOLLIN | LPOLLERR);
if (ret < 0) {
goto error;
}
static
int check_thread_quit_pipe(int fd, uint32_t events)
{
- if (fd == live_thread_quit_pipe[0] && (events & LPOLLIN)) {
+ if (fd == thread_quit_pipe[0] && (events & LPOLLIN)) {
return 1;
}
* main
*/
int live_start_threads(struct lttng_uri *uri,
- struct relay_local_data *relay_ctx, int quit_pipe[2])
+ struct relay_local_data *relay_ctx)
{
int ret = 0;
void *status;
assert(uri);
live_uri = uri;
- live_thread_quit_pipe[0] = quit_pipe[0];
- live_thread_quit_pipe[1] = quit_pipe[1];
-
/* Check if daemon is UID = 0 */
is_root = !getuid();
#include "lttng-relayd.h"
int live_start_threads(struct lttng_uri *live_uri,
- struct relay_local_data *relay_ctx, int quit_pipe[2]);
+ struct relay_local_data *relay_ctx);
void live_stop_threads(void);
struct relay_viewer_stream *live_find_viewer_stream_by_id(uint64_t stream_id);
* 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 };
+int thread_quit_pipe[2] = { -1, -1 };
/*
* This pipe is used to inform the worker thread that a command is queued and
goto exit_listener;
}
- ret = live_start_threads(live_uri, relay_ctx, thread_quit_pipe);
+ ret = live_start_threads(live_uri, relay_ctx);
if (ret != 0) {
ERR("Starting live viewer threads");
goto exit_live;