projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: thread exit vs futex wait/wakeup race
[lttng-tools.git]
/
src
/
bin
/
lttng-relayd
/
main.c
diff --git
a/src/bin/lttng-relayd/main.c
b/src/bin/lttng-relayd/main.c
index 919c5a96a7a2baa1680febd84ccb9e225fa3a386..0eb8e28251f2451ab229dc41cf0e62726fddc7c5 100644
(file)
--- a/
src/bin/lttng-relayd/main.c
+++ b/
src/bin/lttng-relayd/main.c
@@
-71,6
+71,14
@@
#include "connection.h"
#include "tracefile-array.h"
#include "connection.h"
#include "tracefile-array.h"
+static const char *help_msg =
+#ifdef LTTNG_EMBED_HELP
+#include <lttng-relayd.8.h>
+#else
+NULL
+#endif
+;
+
/* command line options */
char *opt_output_path;
static int opt_daemon, opt_background;
/* command line options */
char *opt_output_path;
static int opt_daemon, opt_background;
@@
-250,9
+258,9
@@
static int set_option(int opt, const char *arg, const char *optname)
}
break;
case 'h':
}
break;
case 'h':
- ret = utils_show_
man_page(8, "lttng-relayd"
);
+ ret = utils_show_
help(8, "lttng-relayd", help_msg
);
if (ret) {
if (ret) {
- ERR("Cannot
view man page lttng-relayd(8)
");
+ ERR("Cannot
show --help for `lttng-relayd`
");
perror("exec");
}
exit(EXIT_FAILURE);
perror("exec");
}
exit(EXIT_FAILURE);
@@
-969,12
+977,16
@@
static void *relay_thread_dispatcher(void *data)
health_code_update();
health_code_update();
-
while (!CMM_LOAD_SHARED(dispatch_thread_exit)
) {
+
for (;;
) {
health_code_update();
/* Atomically prepare the queue futex */
futex_nto1_prepare(&relay_conn_queue.futex);
health_code_update();
/* Atomically prepare the queue futex */
futex_nto1_prepare(&relay_conn_queue.futex);
+ if (CMM_LOAD_SHARED(dispatch_thread_exit)) {
+ break;
+ }
+
do {
health_code_update();
do {
health_code_update();
This page took
0.025121 seconds
and
4
git commands to generate.