projects
/
ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add paranoid check before listener thread destruction
[ust.git]
/
libust
/
tracectl.c
diff --git
a/libust/tracectl.c
b/libust/tracectl.c
index ef0155db3388441d83fe3afe813f66b5e78d64e3..03220373c92dee9c7eea7ee259d231de8924b809 100644
(file)
--- a/
libust/tracectl.c
+++ b/
libust/tracectl.c
@@
-15,6
+15,11
@@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+/* This file contains the implementation of the UST listener thread, which
+ * receives trace control commands. It also coordinates the initialization of
+ * libust.
+ */
+
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
@@
-1065,8
+1070,9
@@
void create_listener(void)
if(result) {
PERROR("pthread_sigmask: %s", strerror(result));
}
if(result) {
PERROR("pthread_sigmask: %s", strerror(result));
}
-
- have_listener = 1;
+ else {
+ have_listener = 1;
+ }
}
static int init_socket(void)
}
static int init_socket(void)
@@
-1364,10
+1370,13
@@
int restarting_usleep(useconds_t usecs)
return result;
}
return result;
}
-static void stop_listener()
+static void stop_listener(
void
)
{
int result;
{
int result;
+ if(!have_listener)
+ return;
+
result = pthread_cancel(listener_thread);
if(result != 0) {
ERR("pthread_cancel: %s", strerror(result));
result = pthread_cancel(listener_thread);
if(result != 0) {
ERR("pthread_cancel: %s", strerror(result));
This page took
0.022735 seconds
and
4
git commands to generate.