diff options
author | Amirsaman Memaripour <amirsaman.memaripour@mongodb.com> | 2020-02-25 14:15:28 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-02 17:56:45 +0000 |
commit | 5a3dd86b2e06a065ba435e4a6fe69300d0ba73a0 (patch) | |
tree | c17069779609205bdf693f3325af5da6da2784d7 /src/mongo/transport | |
parent | 6b24ad01b81bc9c455f9679a3d24ce13a7659417 (diff) | |
download | mongo-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.cpp | 2 |
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); |