summaryrefslogtreecommitdiff
path: root/src/mongo/transport
diff options
context:
space:
mode:
authorAmirsaman Memaripour <amirsaman.memaripour@mongodb.com>2020-02-25 14:15:28 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-02 17:56:45 +0000
commit5a3dd86b2e06a065ba435e4a6fe69300d0ba73a0 (patch)
treec17069779609205bdf693f3325af5da6da2784d7 /src/mongo/transport
parent6b24ad01b81bc9c455f9679a3d24ce13a7659417 (diff)
downloadmongo-5a3dd86b2e06a065ba435e4a6fe69300d0ba73a0.tar.gz
SERVER-27896 Add support for enforcing single-thread context
Diffstat (limited to 'src/mongo/transport')
-rw-r--r--src/mongo/transport/service_entry_point_utils.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/transport/service_entry_point_utils.cpp b/src/mongo/transport/service_entry_point_utils.cpp
index f4e894e1168..aab92e246c3 100644
--- a/src/mongo/transport/service_entry_point_utils.cpp
+++ b/src/mongo/transport/service_entry_point_utils.cpp
@@ -40,6 +40,7 @@
#include "mongo/stdx/thread.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/debug_util.h"
+#include "mongo/util/thread_safety_context.h"
#if !defined(_WIN32)
#include <sys/resource.h>
@@ -101,6 +102,7 @@ Status launchServiceWorkerThread(std::function<void()> task) {
pthread_t thread;
auto ctx = std::make_unique<std::function<void()>>(std::move(task));
+ ThreadSafetyContext::getThreadSafetyContext()->onThreadCreate();
int failed = pthread_create(&thread, &attrs, runFunc, ctx.get());
pthread_attr_destroy(&attrs);