summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-01-06 09:37:12 -0500
committerNick Mathewson <nickm@torproject.org>2020-01-06 09:37:12 -0500
commit4f6901d7cc827e5bfa98467b7a568f725ce7fa9f (patch)
treee3c759d5cde1960dfed9fd6497fe68a75c68d247 /src
parent0b3763612cfd74fd8e1ee79f6fbe58a70e4288b8 (diff)
downloadtor-4f6901d7cc827e5bfa98467b7a568f725ce7fa9f.tar.gz
tor-4f6901d7cc827e5bfa98467b7a568f725ce7fa9f.zip
When initializing pthreads, always set the main thread.
Fixes bug 32884. This is a bugfix on 0.3.3.1-alpha, when we started allowing restart-in-process with tor_api.h.
Diffstat (limited to 'src')
-rw-r--r--src/lib/thread/compat_pthreads.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/thread/compat_pthreads.c b/src/lib/thread/compat_pthreads.c
index 05efe9cfd0..6f7ecd17da 100644
--- a/src/lib/thread/compat_pthreads.c
+++ b/src/lib/thread/compat_pthreads.c
@@ -265,6 +265,6 @@ tor_threads_init(void)
pthread_attr_setdetachstate(&attr_detached, PTHREAD_CREATE_DETACHED);
tor_assert(ret2 == 0);
threads_initialized = 1;
- set_main_thread();
}
+ set_main_thread();
}