diff options
author | Gerald Combs <gerald@zing.org> | 2017-11-28 11:04:16 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-11-29 04:43:41 +0000 |
commit | 67ffa3cf7da172df53a821d5cd4c1a6a849f4087 (patch) | |
tree | d6f0d7dd707776eaa1742da2ad1cd4f1195c0532 /dumpcap.c | |
parent | 041e3e7c27c78308d0d515171f52a39f8260782b (diff) |
Threads: Set lifetimes and add a compatibility routine.
Join the protocol registration threads so that they call g_thread_unref
which in turn detaches/terminates the thread. This gets rid of many TSan
and DRD errors here. The remaining ones appear to be false positives.
Add g_thread_new to glib-compat (untested).
Change-Id: I4beb6746ed08656715cf7870ac63ff80cf1ef871
Reviewed-on: https://code.wireshark.org/review/24619
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 8 |
1 files changed, 0 insertions, 8 deletions
@@ -1715,11 +1715,7 @@ cap_pipe_open_live(char *pipename, } #ifdef _WIN32 else { -#if GLIB_CHECK_VERSION(2,31,0) g_thread_new("cap_pipe_open_live", &cap_thread_read, pcap_src); -#else - g_thread_create(&cap_thread_read, pcap_src, FALSE, NULL); -#endif pcap_src->cap_pipe_buf = (char *) &magic; pcap_src->cap_pipe_bytes_read = 0; @@ -3238,12 +3234,8 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct pcap_queue_packets = 0; for (i = 0; i < global_ld.pcaps->len; i++) { pcap_src = g_array_index(global_ld.pcaps, capture_src *, i); -#if GLIB_CHECK_VERSION(2,31,0) /* XXX - Add an interface name here? */ pcap_src->tid = g_thread_new("Capture read", pcap_read_handler, pcap_src); -#else - pcap_src->tid = g_thread_create(pcap_read_handler, pcap_src, TRUE, NULL); -#endif } } while (global_ld.go) { |